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  

How can I get a combo box to get data based on a text box?



 
 
Thread Tools Display Modes
  #11  
Old July 10th, 2007, 05:55 PM posted to microsoft.public.access.forms
[email protected]
external usenet poster
 
Posts: 15
Default How can I get a combo box to get data based on a text box?

Ok,

I entered in this part # "2061M60G27" into the text box

then i clicked the combo box and this came back:

syntax error (missing operator) in query expression 'FieldID =
2061M60G27'.


Any ideas?

  #12  
Old July 10th, 2007, 05:59 PM posted to microsoft.public.access.forms
kingston via AccessMonster.com
external usenet poster
 
Posts: 620
Default How can I get a combo box to get data based on a text box?

2061M60G27 is not a number. Are you sure FieldID is numeric? If it is not,
then you can qualify the input with single quotation marks:

... FieldID = '" & Me.Part & "';"


wrote:
Ok,

I entered in this part # "2061M60G27" into the text box

then i clicked the combo box and this came back:

syntax error (missing operator) in query expression 'FieldID =
2061M60G27'.

Any ideas?


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200707/1

  #13  
Old July 10th, 2007, 06:10 PM posted to microsoft.public.access.forms
[email protected]
external usenet poster
 
Posts: 15
Default How can I get a combo box to get data based on a text box?

Ok,

My FieldID is not numeric, sorry about that. It is a series of
numbers and letters.


I put single quotes in like you said, entered the part # in, then
click on the combo box to choose a date and then a prompt came up
asking for a parameter value for the FieldID. Its not suppose to do
this right? What do you think the issue is now?

  #16  
Old July 11th, 2007, 01:01 PM posted to microsoft.public.access.forms
[email protected]
external usenet poster
 
Posts: 15
Default How can I get a combo box to get data based on a text box?

The name of the field in [Rateset APS] that the part number is coming
from is called "Item_Name"


In the coding I changed "FieldID" to [Rateset APS].[Item_Name]
but still did not work. Is that what I was suppose to do?

  #17  
Old July 11th, 2007, 02:28 PM posted to microsoft.public.access.forms
kingston via AccessMonster.com
external usenet poster
 
Posts: 620
Default How can I get a combo box to get data based on a text box?

Yes, that's what you were supposed to do. Again, when posting in these
forums, be very specific about what doesn't work. Do you get an error
message? If so what is it? Otherwise, does it not work because it doesn't
return the values you think it should return or is the combobox not getting
updated at all? In any event, the following will work provided you replace
the field and control names with your data and you use the correct syntax:

Me.Date.RowSource = "SELECT [Rateset APS].[RATE_SETUP_DATE] FROM [Rateset APS]

WHERE [Rateset APS].[Item_Name] = '" & Me.Part & "';"


wrote:
The name of the field in [Rateset APS] that the part number is coming
from is called "Item_Name"

In the coding I changed "FieldID" to [Rateset APS].[Item_Name]
but still did not work. Is that what I was suppose to do?


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200707/1

  #18  
Old July 11th, 2007, 06:08 PM posted to microsoft.public.access.forms
[email protected]
external usenet poster
 
Posts: 15
Default How can I get a combo box to get data based on a text box?

Sorry, yes I admit, this is my first time to post on this forum so
thank you for your patience.


Ok it worked!

One last issue... when I push the button to pull down the combo box,
it gives multiple entries for the same date. Lets say a part had 2
different dates, 10/03/2007 and 11/08/2007
The combo box would read like this:
10/03/2007
10/03/2007
10/03/2007
10/03/2007
10/03/2007
10/03/2007
11/08/2007
11/08/2007
11/08/2007
11/08/2007
11/08/2007


Then when I click on one of the dates it gives all the 10/03/2007
entries. In this case it would be 6 entries. How can I make it so
the combo box only shows one "10/03/2007" instead of 6 and still pops
out 6 when I run the query?


  #20  
Old July 11th, 2007, 07:11 PM posted to microsoft.public.access.forms
[email protected]
external usenet poster
 
Posts: 15
Default How can I get a combo box to get data based on a text box?

That helped! thanks!

Do you know how I can make the form pop up when someone opens Access
and then lock it so that only the form is showing and only I can
update the database?



 




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 07:54 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.