Grandkathy
Technical User
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
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