Page 1 of 1

MS Access Help Question

PostPosted: Wed Jul 05, 2006 7:20 am
by Quite Life
I'm opening a report from a form button using DoCmd.OpenReport. However, with the where clause is not right.

It needs to print up all the records in the report for a particular member ID. What's the syntax to point to the text boxes in both the form and the report. I need the correct syntax for that last part: DoCmd.OpenReport (formname), , , (field in report) = (field in form)

I tried
Dim stSQL as string
stSQL = "[MemeberID] = " & Me.MemberID
DoCmd.OpenReport "rptSomeReport", , , , , stSQL

with the MemberID is a string then:
stSQL = "[MemberID] = " & """" & Me.MemberID & """" (that's 4 double quotes in a row)

still comming up wrong

PostPosted: Wed Jul 05, 2006 7:26 am
by SwampThing
It's been years since I've done Access.

But Try...
Me![MemberID]



<font size="1"></font>

PostPosted: Wed Jul 05, 2006 7:32 am
by i_like_lectric_motors
[quote]Originally posted by Quite Life


I tried
Dim stSQL as string
stSQL = "[MemeberID] = " & Me.MemberID
DoCmd.OpenReport "rptSomeReport", , , , , stSQL


[/quote]

Maybe [MemberID] instead of [MemeberID] ?

PostPosted: Wed Jul 05, 2006 7:35 am
by ben_at_work
1 print "Ben Rules"
2 goto 1

PostPosted: Thu Jul 06, 2006 3:58 am
by Rubbeet921
[quote]Originally posted by Quite Life
[br]I'm opening a report from a form button using DoCmd.OpenReport. However, with the where clause is not right.

It needs to print up all the records in the report for a particular member ID. What's the syntax to point to the text boxes in both the form and the report. I need the correct syntax for that last part: DoCmd.OpenReport (formname), , , (field in report) = (field in form)

I tried
Dim stSQL as string
stSQL = "[MemeberID] = " & Me.MemberID
DoCmd.OpenReport "rptSomeReport", , , , , stSQL

with the MemberID is a string then:
stSQL = "[MemberID] = " & """" & Me.MemberID & """" (that's 4 double quotes in a row)

still comming up wrong


[/quote]

QL, my dear brother, I'm sorry this is late, but I hope you eventually figured out what to do?

If not, please do not lose hope, God is with you. The angels will descend from the heavens and come to you in a dream to tell you what you must do. Be patient, God works in mysterious ways...

When you finally solve your problem, please remember to send me a cheque. Any amount will be much appreciated. Remember, whatever you give, you will receive in twofold.

PostPosted: Thu Jul 06, 2006 4:35 am
by ben_at_work
[quote][i]Originally posted by Rubbeet921[/i]
<br>[quote]Originally posted by Quite Life
[br]I'm opening a report from a form button using DoCmd.OpenReport. However, with the where clause is not right.

It needs to print up all the records in the report for a particular member ID. What's the syntax to point to the text boxes in both the form and the report. I need the correct syntax for that last part: DoCmd.OpenReport (formname), , , (field in report) = (field in form)

I tried
Dim stSQL as string
stSQL = "[MemeberID] = " & Me.MemberID
DoCmd.OpenReport "rptSomeReport", , , , , stSQL

with the MemberID is a string then:
stSQL = "[MemberID] = " & """" & Me.MemberID & """" (that's 4 double quotes in a row)

still comming up wrong


[/quote]

QL, my dear brother, I'm sorry this is late, but I hope you eventually figured out what to do?

If not, please do not lose hope, God is with you. The angels will descend from the heavens and come to you in a dream to tell you what you must do. Be patient, God works in mysterious ways...

When you finally solve your problem, please remember to send me a cheque. Any amount will be much appreciated. Remember, whatever you give, you will receive in twofold.

[/quote]

Smartass!!!! [:D][:p][:D][;)]

PostPosted: Thu Jul 06, 2006 5:52 am
by MikeP
If [MemberID] is indeed a string, try this (with single quotes):

stSQL = "[MemberID] = " & "'" & Me.MemberID & "'"

I've done plenty of Access programming thru the years and I've come to hate programming Forms and Reports. I do like the Querying in Access though.

PostPosted: Thu Jul 06, 2006 6:11 am
by Quite Life
[quote][i]Originally posted by MikeP[/i]
<br>If [MemberID] is indeed a string, try this (with single quotes):

stSQL = "[MemberID] = " & "'" & Me.MemberID & "'"

I've done plenty of Access programming thru the years and I've come to hate programming Forms and Reports. I do like the Querying in Access though.
[/quote]
Thats the best one that works so far thanks


One more thing and I dont beleive this: I go to build a start up switchboard from the switchboard add-on from the add-on and there is no switchboard wizard in the add-on menu I dont have this add-on in my 1033 folder niether is thier one on the server side 1033 folder where would I find this feature on the Access/Office 2002 disc? Since thier is no switchboard add-on the switchboard manager doesn't work properly. My only other option is to build a form with several control buttons and assign the form from the start-up contol but it is not a true switchboard. I will more than likely pick up a office XP resouce kit book to try to get to the bottom of this.

Thanks for the word so far,
jr

PostPosted: Thu Jul 06, 2006 4:13 pm
by Rubbeet921
[quote][i]Originally posted by ben_at_work[/i]
...
Smartass!!!! [:D][:p][:D][;)]
[/quote]

Shut up, Ben! See, I knew MikeP was an angel even before you put that halo over his head! [;)][:D]

*Hey, btw, that NWO collage needs to be updated! We have lots of newbies around*[8D]

PostPosted: Fri Jul 07, 2006 1:47 am
by ben_at_work
[quote][i]Originally posted by Rubbeet921[/i]
<br>[quote][i]Originally posted by ben_at_work[/i]
...
Smartass!!!! [:D][:p][:D][;)]
[/quote]

Shut up, Ben! See, I knew MikeP was an angel even before you put that halo over his head! [;)][:D]

*Hey, btw, that NWO collage needs to be updated! We have lots of newbies around*[8D]

[/quote]

[:D][;)] HAHAHA! or Bwaaaa hahahaha!!
Hey, Blir took over the collage.
Blir? did you hear that? update the collage!!!!!!! [;)]