i have a query in ms access report that uses a parameters, the problem is, how can i pass a paramater to ms access report using vb code, is this possible?
thanks
leagle
Printable View
i have a query in ms access report that uses a parameters, the problem is, how can i pass a paramater to ms access report using vb code, is this possible?
thanks
leagle
Hey I already did This but you have to tell me what is your final goal .(report ,select) .
i made a query in msaccess that accept a "date" parameter
now, i use this query to build a report also in ms access.
if i run this in ms access it prompts the user to enter the date. i can print the report in vb but how do i pass the required parameters? ... got any idea?
thanks
ok when i did it it was in vb so as for as know you should insert into the view the parameters before the user loads the report such as when he clicks the button you need to insert the parameters and then refresh the view.
for any help response again i will be glad to help
shachar,
thanks for ur help, i'll try what you have just adviced me.. i'll let you know if it works..
i m waiting for your reply
shachar
this is the code that im using to call the report in ms access, what im trying is to run the report w/out displaying the ms access application..
Dim myobjAccess As New Access.Application
myobjAccess.OpenCurrentDatabase ("h:\GL_ACCOUNTS.MDB")
myobjAccess.DoCmd.OpenReport ("TRANS_YEAR_1_REP")
Leagle
try this
You may have to alter the date variable so it is sent as #mm\dd\yyyy#Code:Dim myobjAccess As New Access.Application
Dim sSQl as string
Dim dDate as date
'set dDate to equal the value of the date you want to pass to access
'The SQL contains the the date field in the report and
'the dDate variable
sSQL = "[Date]=" & dDate
myobjAccess.OpenCurrentDatabase ("h:\GL_ACCOUNTS.MDB")
'myobjAccess.DoCmd.OpenReport ("TRANS_YEAR_1_REP")
myobjAccess.DoCmd.OpenReport "TRANS_YEAR_1_REP", _
acViewNormal, , sSQL
Hope this works
Gazza
thanks for all of ur help, now i can sleep :)