A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

needing help with "strWhere" statement



 
 
Thread Tools Display Modes
  #1  
Old October 4th, 2006, 05:36 PM posted to microsoft.public.access.forms,microsoft.public.access.formscoding
Kelvin Beaton
external usenet poster
 
Posts: 231
Default needing help with "strWhere" statement

I'm using a button to print a report, based on the "AISPID" on the current
record on form "frmAnnualISPReview_subform"
I seem to have my syntax wrong, again.
If ""[forms]![frmAnnualISPReview_subform]![AISPID]" points to the field on
the form that I want to print my report for.
What does "Me.AISPID" point to?

Is the syntax where the field on the report = the field on the report?

Where do the "" fit in if the fields are numeric?

strWhere = "[forms]![frmAnnualISPReview_subform]![AISPID] = " &
Me.AISPID
DoCmd.OpenReport "rptAnnualISPReview", acViewPreview, , strWhere

Thanks

Kelvin


  #2  
Old October 4th, 2006, 05:46 PM posted to microsoft.public.access.forms,microsoft.public.access.formscoding
Roger Carlson
external usenet poster
 
Posts: 222
Default needing help with "strWhere" statement

Generally, you put the Field first, then the form control (although I doubt
if it makes much difference). Like this:

strWhere = "[AISPID] = " & [forms]![frmAnnualISPReview_subform]![AISPID]

[AISPID] being a field in the recordsource of your report. And
[forms]![frmAnnualISPReview_subform]![AISPID] being a textbox on your form.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/...UBED1=ACCESS-L


"Kelvin Beaton" kelvin at mccsa dot com wrote in message
...
I'm using a button to print a report, based on the "AISPID" on the current
record on form "frmAnnualISPReview_subform"
I seem to have my syntax wrong, again.
If ""[forms]![frmAnnualISPReview_subform]![AISPID]" points to the field on
the form that I want to print my report for.
What does "Me.AISPID" point to?

Is the syntax where the field on the report = the field on the report?

Where do the "" fit in if the fields are numeric?

strWhere = "[forms]![frmAnnualISPReview_subform]![AISPID] = " &
Me.AISPID
DoCmd.OpenReport "rptAnnualISPReview", acViewPreview, , strWhere

Thanks

Kelvin




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:50 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.