If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Inputbox Value Reference
Hi
I have a form with a button on it that initiates a command that launches an inputbox. The user then inputs the required value to the inputbox and presses OK. My question is this. How do I reference the user inputted value for use within a query? I have looked through all the options in the expression builder and I can not find reference to it. Do I need some form of code to reference the entered value? Any help much appreciated. DaveyC |
#2
|
|||
|
|||
Inputbox Value Reference
DaveyC -
If you have a value stored in a control on a form (and the form is open), then you can refer to it from within the query. It will look like this: =Forms![YourFormName]![YourControlName] If you are using query design, you can use the Expression Builder to navigate to the form control to help prevent typos. -- Daryl S "DaveyC" wrote: Hi I have a form with a button on it that initiates a command that launches an inputbox. The user then inputs the required value to the inputbox and presses OK. My question is this. How do I reference the user inputted value for use within a query? I have looked through all the options in the expression builder and I can not find reference to it. Do I need some form of code to reference the entered value? Any help much appreciated. DaveyC |
#3
|
|||
|
|||
Inputbox Value Reference
One way is to assign the input value to a text box on your form (the text box
can be hidden) and the use the text box value as the critteria in your query. The only problem with this is that as the input changes so does the criteria. "DaveyC" wrote: Hi I have a form with a button on it that initiates a command that launches an inputbox. The user then inputs the required value to the inputbox and presses OK. My question is this. How do I reference the user inputted value for use within a query? I have looked through all the options in the expression builder and I can not find reference to it. Do I need some form of code to reference the entered value? Any help much appreciated. DaveyC |
#4
|
|||
|
|||
Inputbox Value Reference
Daryl & Mike many thanks, I have used a combination of your ideas and some
code to solve the issue. Private Sub Command118_Click() Dim Message, Title, Default, NewAnalysisRef Message = "Enter New Analysis Reference" ' Set prompt. Title = "Copy Current Analysis" ' Set title. Default = "COPY001" ' Set default. ' Display message, title, and default value. NewAnalysisRef = InputBox(Message, Title, Default) Forms![frm_Analysis]![Text119] = NewAnalysisRef End Sub where Text119 is hidden on the form, I always wondered why you would want to hide something on a form... now I know! DaveyC "Mike" wrote: One way is to assign the input value to a text box on your form (the text box can be hidden) and the use the text box value as the critteria in your query. The only problem with this is that as the input changes so does the criteria. "DaveyC" wrote: Hi I have a form with a button on it that initiates a command that launches an inputbox. The user then inputs the required value to the inputbox and presses OK. My question is this. How do I reference the user inputted value for use within a query? I have looked through all the options in the expression builder and I can not find reference to it. Do I need some form of code to reference the entered value? Any help much appreciated. DaveyC |
Thread Tools | |
Display Modes | |
|
|