|
-
May 26th, 2000, 05:19 PM
#1
Thread Starter
New Member
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
-
May 27th, 2000, 03:58 PM
#2
Lively Member
Final Goal
Hey I already did This but you have to tell me what is your final goal .(report ,select) .
-
May 27th, 2000, 05:24 PM
#3
Thread Starter
New Member
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
-
May 28th, 2000, 02:01 PM
#4
Lively Member
parameters in access reports
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
-
May 29th, 2000, 04:41 PM
#5
Thread Starter
New Member
shachar,
thanks for ur help, i'll try what you have just adviced me.. i'll let you know if it works..
-
May 29th, 2000, 05:47 PM
#6
Lively Member
Access
i m waiting for your reply
-
May 30th, 2000, 04:51 PM
#7
Thread Starter
New Member
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")
-
May 30th, 2000, 05:08 PM
#8
Fanatic Member
Leagle
try this
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
You may have to alter the date variable so it is sent as #mm\dd\yyyy#
Hope this works
Gazza
-
Jun 1st, 2000, 03:54 PM
#9
Thread Starter
New Member
thanks for all of ur help, now i can sleep
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|