Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refer to Field on Forms - Access 2000

Status
Not open for further replies.

fredk

Technical User
Jul 26, 2001
708
US
I am sorry to post this again but looking for help - I have queries that use a form with a tab control as the filter - for some reason, I get a message that access can't find the field 'forms' referred to in my expression"

The problem is that the button will work several times and then I will get this message - I have about 12 reports on the different tabs - it is not just one report but random

Any help would be greatly appreciated!!!!

Thanks!!!!

Fred
 
can you post some code to show where the error occurs, and how you are using it.
 
Hi MajP - The button that I use was created by the wizard and just opens the report- The message that I occasionally get when I press one of the buttons is:

Microsoft Access can't find the field 'forms' ref to in your expression

In my queries, I refer to the form to filter. Not sure if the sql will help you from one of the queries but here it is:

SELECT tblGroups.Market, Count(tblActivity.MainGroupNumber) AS CountOfMainGroupNumber
FROM tblGroups INNER JOIN tblActivity ON tblGroups.MainGroupNumber = tblActivity.MainGroupNumber
WHERE (((tblActivity.Date) Between [forms]![frmreport]![startdate] And [forms]![frmreport]![enddate]))
GROUP BY tblGroups.Market
HAVING (((tblGroups.Market)=[forms]![frmreport]![market])) OR ((([forms]![frmreport]![market]) Is Null));

I also have a problem with the sub-form just showing blank occasionally (not sure if that is related)

Also, I am using a tab control on the form - not sure if that matters ??

Thanks!!!
 
If frmReport closes out before the query executes you could get this error, because it is looking for the values of the fields on a form which is no longer open.
Since the error is intermittent, I think that it has to do with frmReport closing before the query returns all the records. Sometimes this can happen depending on how long it takes to resolve the query.
Please show the code on frmReport that opens the reports.
 
Hi - here is the code from one of the buttons that runs the report:

Private Sub Command25_Click()
On Error GoTo Err_Command25_Click

Dim stDocName As String

stDocName = "rptActivityByMarket"
DoCmd.OpenReport stDocName, acPreview

Exit_Command25_Click:
Exit Sub

Err_Command25_Click:
MsgBox Err.Description
Resume Exit_Command25_Click

End Sub


Thanks!!!

Fred
 
I think I may have resolved my issue - I had a tab conrol on my form. I placed the tab control in the detail section rather than the header - I just moved the tab control to my header and, so far, everything seems to be resolved.

Thanks!!!!

Fred
 
I spoke too soon - still having the problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top