Solved

Access 2007 user input to drive opening a new form

Posted on 2013-01-24
3
383 Views
Last Modified: 2013-01-24
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
0
Comment
Question by:FaithDan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 38814373
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
    Forms![Input_Form_with_Drop_down_box].Text24 = InputBox(" what Is todays letter?")

Exit_Command20_Click:
    Exit Sub

Open in new window

0
 
LVL 1

Author Closing Comment

by:FaithDan
ID: 38814438
Thank you very much.. that worked great
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 38814441
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
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question