Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Access 2007 user input to drive opening a new form

Posted on 2013-01-24
3
Medium Priority
?
388 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
3 Comments
 
LVL 61

Accepted Solution

by:
mbizup earned 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

783 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