T
trekgoes2malaysia
I am having difficulty using VBA to set a value for a combo box
control that resides on a subform based on the value in a text box
control on a parent form. I know how to do this for textbox controls
but Access 2003 does not seem to allow me to do this with a combo box
using the same method. It returns the error "You can't assign a value
to this object". So how do I assign a value to a combo box then? Below
is my code:
Private Sub Form_Open(Cancel As Integer)
Dim strtable As String
Dim strtable2 As String
Dim getvenueid As Integer
Dim sql As String
Dim sql2 As String
strtable = "Venue"
getvenueid = [Forms]![track session]![venueid]
sql = "[venueid] = " & getvenueid
getsize = DLookup("[Size]", strtable, sql)
Me.cboTrackSize = getsize
With Gratitude,
Patrick
control that resides on a subform based on the value in a text box
control on a parent form. I know how to do this for textbox controls
but Access 2003 does not seem to allow me to do this with a combo box
using the same method. It returns the error "You can't assign a value
to this object". So how do I assign a value to a combo box then? Below
is my code:
Private Sub Form_Open(Cancel As Integer)
Dim strtable As String
Dim strtable2 As String
Dim getvenueid As Integer
Dim sql As String
Dim sql2 As String
strtable = "Venue"
getvenueid = [Forms]![track session]![venueid]
sql = "[venueid] = " & getvenueid
getsize = DLookup("[Size]", strtable, sql)
Me.cboTrackSize = getsize
With Gratitude,
Patrick