enter parameter value

joeblow2

Registered User.
Local time
Today, 12:29
Joined
Jun 28, 2008
Messages
39
Hi:

I have two list boxes on a form- one called List12 and the other Program_id. What I want to do is that when the user selects Program_description in List12, the Program_id List box should be populated with Program_id. It does it but only after I get a "Enter Parameter value" prompt and I have to enter the Program_description.
I want this ofcourse done automatically. Both Program_id and Program_description are fields of a Program table.
Here is the code that I have:

Private Sub List12_AfterUpdate()

With Me.[Program_id]

.RowSource = "SELECT [Program_id] " & _
"FROM Program " & _
"WHERE [Program_description]=" & Me.List12

Call .Requery
End With
End Sub

Thanks in advance
 
If the field is text, which it sounds like, try:

"WHERE [Program_description]='" & Me.List12 & "'"
 
Thanks a lot--it works!
 

Users who are viewing this thread

Back
Top Bottom