Solved

Access 2007 user input to drive opening a new form

Posted on 2013-01-24
3
382 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 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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 …

762 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