StudentHelp
New member
- Local time
- Today, 21:15
- Joined
- Apr 1, 2014
- Messages
- 7
Hello everybody!
I need Help!!
When i try to run this set of VBA code:
I get this macro pop up box open up (Pic attached)
Any Ideas to Remedy this?
Many thanks
I need Help!!
When i try to run this set of VBA code:
Code:
Private Sub Command24_Click()
Dim BookingAvailable As Variant
BookingAvailable = "Yes"
If (Eval("=DLookUp(""[Viewing ID]"",""Viewing"",""Staff_Viewing_ID= Forms![Booking Screen]![AgentCombo] AND [Viewing Period]= Forms![Booking Screen]![ViewingCombo] AND [Date_of_viewing]= Forms![Booking Screen]![ViewingDate]"") Is Not Null")) Then
Beep
MsgBox "Agent Not Available", vbOKOnly, "Error"
BookingAvailable = "No"
End If
If (Eval("=DLookUp(""[Viewing ID]"",""Viewing"",""Property_Viewing_ID= Forms![Booking Screen]![PropertyCombo] AND [Viewing Period]= Forms![Booking Screen]![ViewingCombo] AND [Date_of_Viewing]= Forms![Booking Screen]![ViewingDate]"") Is Not Null")) Then
Beep
MsgBox "Property Already Has A Booking", vbOKOnly, "Error"
BookingAvailable = "No"
End If
If (Eval("=DLookUp(""[Viewing ID]"",""Viewing"",""Customer_Viewing_ID= Forms![Booking Screen]![BuyerCombo] AND [Viewing Period]= Forms![Booking Screen]![ViewingCombo] AND [Date_Of_Viewing]= Forms![Booking Screen]![Viewing Date]"") Is Not Null")) Then
Beep
MsgBox "Buyer Is Already On A Viewing", vbOKOnly, "Error"
BookingAvailable = "No"
End If
If (BookingAvailable = "Yes") Then
Beep
MsgBox "Booking Confirmed", vbOKOnly, "Sucess"
DoCmd.OpenQuery "AppendQuery", acViewNormal, acEdit
End If
End Sub
I get this macro pop up box open up (Pic attached)
Any Ideas to Remedy this?
Many thanks