Click Vs Double Click

mtagliaferri

Registered User.
Local time
Today, 23:51
Joined
Jul 16, 2006
Messages
550
Following yesterday post that went missing after the crash....

As click and double click on the same text box can be tricky I need to be able to double click on a text box that if it empty will open form A if it has a value already will open form B.
I was recomended yesterday to use the If Else statement, I have done so but it is still not working.

Code:
Private Sub Staff_Number_DblClick(Cancel As Integer)
On Error GoTo Err_DblClick_Click

    If RoomNumber = Null Then
    DoCmd.OpenForm "frmA", acNormal, "", "", acEdit, acDialog

Else
    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "frmB"
   
    stLinkCriteria = "[IDRoomNumber]=" & Me![IDRoomNumber]
    
    DoCmd.OpenForm stDocName, , , stLinkCriteria
    

Exit_DblClick_Click:
    Exit Sub

Err_DblClick_Click:
    MsgBox Err.Description
    Resume Exit_DblClick_Click
    End If
End Sub

I get an error "Syntax error (missing operator) in query expression '[IDRoomNumber]=' .

Any help pleasee :banghead:
 
its too risky to have click and dbl-click events on 1 box.
but
for code: IF ISNULL(txtBox) THEN

for queries: txtbox is null
 
You cant compare anything to null. So

If RoomNumber = Null Then

Is not valid. Use:

If IsNull(RoomNumber) Then

Instead.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom