A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Inputbox Value Reference



 
 
Thread Tools Display Modes
  #1  
Old February 25th, 2010, 03:52 PM posted to microsoft.public.access.forms
DaveyC
external usenet poster
 
Posts: 11
Default 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  
Old February 25th, 2010, 04:58 PM posted to microsoft.public.access.forms
Daryl S[_2_]
external usenet poster
 
Posts: 881
Default 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  
Old February 25th, 2010, 04:58 PM posted to microsoft.public.access.forms
mike
external usenet poster
 
Posts: 3,942
Default 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  
Old February 25th, 2010, 05:49 PM posted to microsoft.public.access.forms
DaveyC
external usenet poster
 
Posts: 11
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:21 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.