"ndn_24_7" <nd******@yahoo .com> wrote in message
news:11******** **************@ c13g2000cwb.goo glegroups.com.. .
I'm sorry
I should have been more discriptive. My program has a Access 2000 front
end and a SQL 2000 server backend. I have a button that the user clicks
that brings up the prompt window for the stored proc. So would I do
this on the Access front end, Where would Icustomize this message?
I suggest you want a form that the user enters the dates in and then clicks
the button to run the stored proc.
I'll assume you know a little about VB code.
Otherwise, you got a steep learning curve ahead mate.
You probably want to validate the fields using isdate()
Access now uses ADO, so the code involves using an ado connection and
command.
I found pretty much the below code by using google to search the access
newsgroup.
Not tested it and I had to add the execute line, so this is just to get you
started.
BTW You'll want to get used to doing such searches if you are new to this
lark.
I suggest also take a look at each of the bits in turn and read up using
msdn so you get a better understanding what you're up to.
I have deliberately not changed the parameter type to date and input because
you'd learn stuff all if I just gave you the code.
There's a couple gotchas with datetime. Inside access some bits want this
delimited by # but not with ado. Remember also the time bit of a date is
likely there. Not such a problem with > or < but throw that to the back of
your mind for later.
Anyhow.
You run the thing by using the execute method of the command.
There's a parameter collection associated with a command you add the values
to:
'start untested snippet
Dim cmd As ADODB.Command
Dim prm As ADODB.Parameter
Set cmd = New ADODB.Command
cmd.ActiveConne ction = CurrentProject. Connection
cmd.CommandText = "stored procedurename"
cmd.CommandType = adCmdStoredProc
Set prm = cmd.CreateParam eter("@CompanyI D", adInteger, adParamOutput _
, , forms!yourformn ame!text1.Value )
cmd.Parameters. Append prm
cmd.execute
set prm = Nothing
Set cmd = Nothing
' end snippet
HTH
--
Regards,
Andy O'Neill