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
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
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command20_Click:
Exit Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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
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
private sub form_load()
if me.openargs & ""<>"" then
me.textbox=me.openargs
end if
end sub
ASKER