VBa Code on click Macro box?

StudentHelp

New member
Local time
Today, 19:31
Joined
Apr 1, 2014
Messages
7
Hello everybody!

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
 

Attachments

  • Macros PopUp.jpg
    Macros PopUp.jpg
    17.8 KB · Views: 123
Did I not help you out in the other thread - Error 2950? Any reason you have started a new one?
 
When i tried running your code this problem started, i have now tried with another set of code that works on other peoples Databases, but the problem is still there
 

Users who are viewing this thread

Back
Top Bottom