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  dBforums > PC based Database Applications > Microsoft Access > Passing specific ComboBox info to a Query

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-08-10, 09:22
pwdpwd pwdpwd is offline
Registered User
 
Join Date: Feb 2010
Posts: 7
Passing specific ComboBox info to a Query

Hi - hope someone can help.

What I'm trying to do is to select service dates within a 53 week year - and the year doesn't always start on the 1st Jan. When I use specific criteria in the ServiceDate field in the query (dd/mm/yyyy), such as:

"Between #28/12/2009# And (#28/12/2009#+371)"

it works fine.

When I use a text box (set to dd/mm/yyyy) and set the criteria to:

"Between Forms!FRM_FormName!TextBox and (Forms!FRM_FormName!TextBox +371)"

it also works fine

I don't want the user to have to remember the exact start date of each year, so I created a tbltablestartdate table; with 3 fields - ID, year and yearstartdate.

On the form I created & bound a combobox to that table, but only display the year. I want to let the user select the year (yyyy) but use the yearstartdate (dd/mm/yyyy) as the criteria in the query. I substituted 'Combobox' for 'TextBox' making sure that the bound column was the right one for yearstartdate, but that doesn't work either.
Reply With Quote
  #2 (permalink)  
Old 02-08-10, 14:39
Sinndho Sinndho is offline
Registered User
 
Join Date: Mar 2009
Posts: 3,444
You can address any column of a combo or list box and get its value with the syntax:
Code:
Me.Comboabc.Column(x)
Where Comboabc is the name of the combo and x is an integer so that the first column is Column(0), the second is Column(1), etc.
You can even consider the combo (or list) as an array and use the syntax:
Code:
Me.Comboabc.Column(x, y)
where x is the column (from 0 to ColumnCount - 1) and y is the line (from 0 to LineCount - 1).
__________________
Have a nice day!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On