Link to home
Start Free TrialLog in
Avatar of FaithDan
FaithDan

asked on

Access 2007 user input to drive opening a new form

I have a start Form that has a button on it that will open up another form.

The code that is on this button that opens the second form is below.  This code works perfect.  My question is I need this button to ask the user a question after it has been clicked and place the users typed answer into a text field on the new form that it is opening.

It need to ask… “what Is todays letter”  and the user will type in l or g or z .. (a letter) any ways.. how can I ask this question after clicking the button and placing this result in “text24” of the new form that is being opened?

Thanks
____________________________
Private Sub Command20_Click()
On Error GoTo Err_Command20_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

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

Exit_Command20_Click:
    Exit Sub
ASKER CERTIFIED SOLUTION
Avatar of mbizup
mbizup
Flag of Kazakhstan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of FaithDan
FaithDan

ASKER

Thank you very much.. that worked great
try this

Private Sub Command20_Click()
On Error GoTo Err_Command20_Click

    Dim stDocName As String
    Dim stLinkCriteria As String
     Dim varInput
    stDocName = "Input_Form_with_Drop_down_box"
   
    varInput = InputBox("What is the letter of the day?")
    If varInput & "" <> "" Then

    DoCmd.OpenForm stDocName, , , stLinkCriteria, , , varInput
     End If
Exit_Command20_Click:
    Exit Sub


in the load event of form "Input_Form_with_Drop_down_box"

private sub form_load()

if me.openargs & ""<>"" then

    me.textbox=me.openargs
end if

end sub