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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Invalid Qualifer Error Message

Status
Not open for further replies.

Grandkathy

Technical User
Jan 13, 2005
32
0
0
US
Hi, This code is the first step in verifying availability of a piece of equipment on a certain date.

I keep getting an error message
"Compile Error:"
"Invalid Qualifer"

It keeps stopping on the RDO, RDI, RTO and RTI variables, I've tried commenting them out, and it compiles okay. I've even tried changing the name of the variables, and that doesn't work either.

I've verified the field names on the corresponding form and the recordset table.

HELP!

Option Compare Database
Dim VDO As Date, VDI As Date, VTO As Date, VTI As Date, RDO As Date, RDI As Date, RTO As Date, RTI As Date, REI, VCI, VWH
Public Function Scenario1()

DoCmd.SetWarnings False
DoCmd.OpenQuery "rqEquipOnlyWhatsAvail_Check"
DoCmd.SetWarnings True

strSQL = "tblAvailEquip_Check" 'temp table run from query
Set cnn = CurrentProject.Connection 'sets the connection to current database
Set rst = New ADODB.Recordset 'sets the recordset to a new ADODB recordset
rst.Open strSQL, cnn, adOpenStatic, adLockOptimistic, adCmdTable 'opens the recordset

VDO = Forms!frmreservations.txtBeginDate
VDI = Forms!frmreservations.txtEndDate
VTO = Forms!frmreservations.txtBeginTime
VTI = Forms!frmreservations.txtEndTime
VEI = Forms!frmreservations.txtEquipID
VCI = Forms!frmreservations.CustomerID
VWH = Forms!frmreservations.txtWhere

RDO = rst.Fields.Item("DateDueOut")
RDI = rst.Fields.Item("DateDueIn")
RTO = rst.Fields.Item("TimeDueOut")
RTI = rst.Fields.Item("TimeDueIn")

While Not rst.EOF
If VEI = rst.EOF Then
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
VCI.Locked = True
REI.Locked = True
RDI.Locked = True
RDO.Locked = True
RTO.Locked = True
RTI.Locked = True
VWH.Locked = True
Exit Function
End If
Wend
End Function
 
What are the names of tblAvailEquip_Check's fields ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
DateDueOut, DateDueIn, TimeDueOut, TimeDueIn.

RDO = rst.Fields.Item("DateDueOut")
RDI = rst.Fields.Item("DateDueIn")
RTO = rst.Fields.Item("TimeDueOut")
RTI = rst.Fields.Item("TimeDueIn")

Thanks
 
You are declaring a lot of things as variables, but you are also treating them as controls, which are they?

A variable does not have a .Locked property, but a form control has. If you have form controls with the same name as variables, you are creatin headaches, errors... I think, better use a naming convention to prevent such.

Roy-Vidar
 
Okay, that makes sense. I'll try and fix it.

Thanks for your time.
 
That got rid of my error messages, thank you for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top