message box value chooses which form to open

antonyx

Arsenal Supporter
Local time
Today, 23:04
Joined
Jan 7, 2005
Messages
556
hi, is there a way to read in what the user types to open a specific form?

eg.. they click a button.. it displays

1. Form A
2. Form B
3. Form C

and there is a box.. and if they type 1. form a opens.. etc?
 
would it resemble something like this??


Code:
Dim formSelect as Number

formSelect = InputBox("1. Form A, 2. Form B:", "formSelect")

If formSelect = 1 Then

Dim stDocName As String
    
Dim stLinkCriteria As String

    stDocName = "form_a"
    DoCmd.OpenForm stDocName, , , stLinkCriteria

End If

If formSelect = 2 Then

Dim stDocName As String
    
Dim stLinkCriteria As String

    stDocName = "form_b"
    DoCmd.OpenForm stDocName, , , stLinkCriteria

End If
 
Wouldn't an optionn group work for you???



Private Sub cmdOpenOptionForm_Click()

Select Case Me.optPickForm
Case Is = 1
DoCmd.OpenForm "formA", , , , acFormAdd

Case Is = 2
DoCmd.OpenForm "formB", , , , acFormAdd

End Select

End Sub
 
CEH said:
Wouldn't an optionn group work for you???



Private Sub cmdOpenOptionForm_Click()

Select Case Me.optPickForm
Case Is = 1
DoCmd.OpenForm "formA", , , , acFormAdd

Case Is = 2
DoCmd.OpenForm "formB", , , , acFormAdd

End Select

End Sub


could you describe in a little more detail what that is, and how i implement it
 
it is saying if they type '1' open this form, if they type '2' open this form and so on
 
i see.. how do i distinguish whether it is 1, or 2.. will i still need a message alert box where the user can type in a value?
 
If I read your post correctly you are trying to allow a form to be opened by picking it or entering the name.........

Here's a few examples of different ways
 

Attachments

mate you are a legend.. seriously

thank you
 

Users who are viewing this thread

Back
Top Bottom