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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

modifying the RowSource property in VB

Status
Not open for further replies.

dfwelch

Programmer
Dec 5, 2003
51
US
I want to change the Row Source of a pull-down list based on the value selected in another field on the form. There will be only two possibilities. I have 2 tables (SCA and SOC) containing the values I want in both cases.

I am writing a VB procedure to run at the OnExit event for the later field. Is this the beginning of the correct syntax to make that change, and what is the rest?

If Forms!Form1!Frame10 = 1 Then
Me.REFNUM1.RowSource = SCA
Else
Me.REFNUM1.RowSource = SOC
End If
 
Quotes around the table names, if they are litteral names. Some like to throw in a requery of the list/combo, but it shouldn't be necessary. Perhaps ensure the correct rowsource also when the form loads? Perhaps use the afer update event of the control in stead of the exit event? What problem are you experiencing? Is the row source type table/query?

Roy-Vidar
 
I had already tossed in the quotes and it works. Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top