force a specific form to open based on value selected

cinders

Registered User.
Local time
Today, 03:41
Joined
Aug 28, 2001
Messages
48
Hello,

I have a form where you enter an ID for a container. There is another field where enter either 1 - for an Empty container or 2 - for a full container. If 1 is entered I need a new form for Empty containers to open. If 2 is entered I need a different form to opne for Full containers.

Does anyone know how to do this?

Thanks
 
Code:
    Private Sub txtContainerID_AfterUpdate()
        If Me.txtContainerID = 1 Then
            DoCmd.OpenForm "frmEmptyContainer", acNormal
        Else
            DoCmd.OpenForm "frmFullContainer", acNormal
        End If
    End Sub

I don't know whether you have a combo box allowing the user to select the 'full' or 'empty' categories or a textbox, but if it is the latter then you may want to consider putting a validation rule in the textbox. i.e. Between 1 And 2
 

Users who are viewing this thread

Back
Top Bottom