emanuele
the old good fellow Bill
- Local time
- Today, 07:49
- Joined
- Jan 23, 2003
- Messages
- 23
can someone take a look this code? it is not working... : I mean all the simple codes work if I write one by one, but when I write all these "elseIf" I have problems. I understand I do no know how to write it and I need some information about how to use If, else if....then
Anyone can suggest where to find it?
Thanks again for all the support and the help I´ve got just reading all the other topics..
Private SubPrivate Sub Kommandoknapp28_Click()
On Error GoTo Err_Kommandoknapp28_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
If Me.checkin = 0 Then
MsgBox "INSERT CHECK IN DATE"
DoCmd.GoToRecord acDataForm, "checkin", acGoTo, 7
ElseIf Me.Betalningsdatum = 0 Then
MsgBox "INSERT CHECK OUT DATE"
DoCmd.GoToRecord acDataForm, "Betalningsdatum", acGoTo, 7
ElseIf Me.Given_Points >= 10 And Me.status = "1" Then
MsgBox "CONGRATULATIONS!! YOU NOW REACHED SILVER STATUS"
Dim stDocName As String
stDocName = "silver"
DoCmd.OpenReport stDocName, acNormal
ElseIf Me.Given_Points >= 30 And Me.status = "2" Then
MsgBox "CONGRATULATIONS!! YOU NOW REACHED PLATINUM STATUS"
stDocName = "platinum"
DoCmd.OpenReport stDocName, acNormal
End If
DoCmd.Close
Exit_Kommandoknapp28_Click:
Exit Sub
Err_Kommandoknapp28_Click:
MsgBox Err.Description
Resume Exit_Kommandoknapp28_Click
End Sub Kommandoknapp28_Click()
Anyone can suggest where to find it?
Thanks again for all the support and the help I´ve got just reading all the other topics..
Private SubPrivate Sub Kommandoknapp28_Click()
On Error GoTo Err_Kommandoknapp28_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
If Me.checkin = 0 Then
MsgBox "INSERT CHECK IN DATE"
DoCmd.GoToRecord acDataForm, "checkin", acGoTo, 7
ElseIf Me.Betalningsdatum = 0 Then
MsgBox "INSERT CHECK OUT DATE"
DoCmd.GoToRecord acDataForm, "Betalningsdatum", acGoTo, 7
ElseIf Me.Given_Points >= 10 And Me.status = "1" Then
MsgBox "CONGRATULATIONS!! YOU NOW REACHED SILVER STATUS"
Dim stDocName As String
stDocName = "silver"
DoCmd.OpenReport stDocName, acNormal
ElseIf Me.Given_Points >= 30 And Me.status = "2" Then
MsgBox "CONGRATULATIONS!! YOU NOW REACHED PLATINUM STATUS"
stDocName = "platinum"
DoCmd.OpenReport stDocName, acNormal
End If
DoCmd.Close
Exit_Kommandoknapp28_Click:
Exit Sub
Err_Kommandoknapp28_Click:
MsgBox Err.Description
Resume Exit_Kommandoknapp28_Click
End Sub Kommandoknapp28_Click()
Last edited: