Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dataset Reference for comboBox

Status
Not open for further replies.

MsMope

IS-IT--Management
Sep 3, 2003
83
US
Good Morning,
I have a form with 1 textbox, (NOT UPDATABLE, the value is pulled in via a module is_modGetCurrentID()) 3 comboboxes and one list box, here is what I want to do.
I want to have the the values input from my table into the corresponding comboboxes for the existing records, here is the table set up:
Code:
ID	OutlineID	FieldName	UserName	DateOfUpdate	NewValue	Note
1	JOB53836 	Date_Approved	paulw	12/11/2003	12/12/2003	
2	JOB53836	Date_Approved	paulw 	12/11/2003		      none to day
3	JOB0pbook	Date_Wanted	paulw 	12/11/2003		
4	JOB0pbook 	Date_Required	paulw	12/11/2003	12/23/2003	
7	JOB0pbook 	Date_Wanted	paulw	12/11/2003	12/18/2003	next
8	JOB0pbook 	Date_Wanted	paulw	12/11/2003	12/17/2003	none

So I have comboBox for field name, user name, date of update and then the list box for notes. I want the cboboxes to display the corresponding entry for the specific job and the list box to display the notes based on selections. I know how to bind a dataset in vb.net, but not in vba, no wizards :) any help or website links would be great.
Thanks,
MsMope

 
The idea here Msmope, is to dynamically, build an SQL statement for the listboxes recordsource.

Dim SQL AS String

SQL = SELECT txtNotes FROM tblOutline? WHERE FieldName = '" & cboFieldName & "' AND UserName = '" & cboUserName & "' AND DateOfUpdate = #" & cboDateOfUpdate & "#"

Me.ListBox.Recordsource = SQL

Now, this is the basic idea.

you may want to check whether or not, a combobox has been selected...
I personally, would make a Public Sub/Function, within the class module, & with the after update of EACH combo, run the function, testing first for, which combo's have been selected.

hope this helps, Good Luck!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top