D
Debbie
Hello all,
I know there are many appends on this but I just can't get this to work.
I have an unbound main form (Main). On it are several subforms. The first
subform (Vehicle) contains a summary of the vehicles. When I click on one of
the vehicles, I would like the second subform (Vehicle Allocation History) to
display records for the vehicle selected in the Vehicle form. Below is my
code:
Dim VehAlloc As Control
Dim Main As Form
Dim VIN As String
Dim SQL As String
Set Main = Forms("VehicleSummaryForm")
Set VehAlloc = Main.VehicleAllocationHistory
VIN = Me!VIN
SQL = "SELECT * FROM Vehicle WHERE VIN = '" & VIN & "'"
VehAlloc.Form.RecordSource = SQL
I keep getting an error saying that I'm making an invalid reference. I have
tried the Parent property, fully qualifying form names and other stuff which
is now all a blur. I also tried the statement VehAlloc.Recordsource = SQL
but that didn't work. Does any one have any idea as to why this won't work?
Any suggestions would be most appreciated. Thanks in advance.
Debbie
I know there are many appends on this but I just can't get this to work.
I have an unbound main form (Main). On it are several subforms. The first
subform (Vehicle) contains a summary of the vehicles. When I click on one of
the vehicles, I would like the second subform (Vehicle Allocation History) to
display records for the vehicle selected in the Vehicle form. Below is my
code:
Dim VehAlloc As Control
Dim Main As Form
Dim VIN As String
Dim SQL As String
Set Main = Forms("VehicleSummaryForm")
Set VehAlloc = Main.VehicleAllocationHistory
VIN = Me!VIN
SQL = "SELECT * FROM Vehicle WHERE VIN = '" & VIN & "'"
VehAlloc.Form.RecordSource = SQL
I keep getting an error saying that I'm making an invalid reference. I have
tried the Parent property, fully qualifying form names and other stuff which
is now all a blur. I also tried the statement VehAlloc.Recordsource = SQL
but that didn't work. Does any one have any idea as to why this won't work?
Any suggestions would be most appreciated. Thanks in advance.
Debbie