Message error

raphael99

Registered User.
Local time
Today, 02:19
Joined
Apr 6, 2015
Messages
126
Hi.
i would like to have a message box if the user take to run a command box before to choose a patient.
Here is what I get:
Code:
If Not CurrentProject.AllForms("MascheraPrincipale").IsLoaded Then
    MsgBox "Necessario scegliere un paziente prima di accedere a quest'area", vbOKOnly, "Errore"
    DoCmd.OpenForm "FRM_SearchMulti"
  Else
    Select Case control.ID
              
        Case Else
            DoCmd.OpenForm "MascheraPrincipale", , , "ID = " & Forms!MascheraPrincipale!ID
    End Select
  End If
Otherwise if a patient is already choose the following:
Code:
DoCmd.OpenForm "FRMPIP", , , "ID = " & Forms!FRM_SearchMulti!SearchResults.Column(6)
The command button should have two functions.
 
Hi VbaInet.
i get it solved:
Code:
If Not CurrentProject.AllForms("MascheraPrincipale").IsLoaded Then
    MsgBox "Necessario scegliere un paziente prima di accedere a quest'area", vbOKOnly, "Errore"
    DoCmd.OpenForm "FRM_SearchMulti"
  
              
         Else
            DoCmd.OpenForm "FRMPIP", , , "ID = " & Forms!FRM_SearchMulti!SearchResults.Column(6)
   
  End If

The user select a patient record double clicking on the row of form: FRM_SearchMulti
Now I got my message error and open to FRM_SearchMulti where user can select patient.
Otherwise if patient is already selected it open FRMPIP

Thanks VbaInet
 

Users who are viewing this thread

Back
Top Bottom