B
brback
Hi, ive already searched the forums for a solution to my problem, but still i
havent been able to solve it. Ive also taken a look at
http://www.mvps.org/access/forms/frm0028.htm
I got 4 tables; Car, Cargroup, Rentaltype, Contract
with these fields:
Car
---------------------
CarNR (Primary Key)
Cargroup
Model
Year
Cargroup
--------------------
Cargroup (Primary Key)
Description
Rentaltype
--------------------
Rentalid (Primary Key)
Cargroup
Rentalprice
Timetype
Contract
---------------------
ContractID (Primary key)
CarNR (related from table car)
Cargroup (related from table cargroup)
Rentalid (related from table rentaltype)
Ive made a query with these fields, and combo boxes of ([Car].[CarNR]) and (
[Rentaltype].[Rentalid]) in a new form. What i want to do is to first set
CarNR, which means [Car].[Cargroup] is set along with it. Then i want to
filter the Rentaltype combo box to only show options where [Rentaltype].
[Cargroup] = [Car].[Cargroup]
This is what ive made out of the CarNR_Afterdupate, combo box:
Private Sub CarNR_AfterUpdate()
Dim strSQL As String
strSQL = "Select " & Me!Cargroup
strSQL = strSQL & " from Rentaltype"
Me!Rentalid.RowSourceType = "Table/Query"
Me!Rentalid.RowSource = strSQL
End Sub
I'm able to set CarNR first, but when i try to pick Rentalid im told to set a
parametervalue for what ever value [Car].[Cargroup] may have. In other words
i cant make it work.
I'm pretty new to the forums so if you have any troubles understanding what
im trying to state please say so.
Thanks alot in advance to any help or tips
havent been able to solve it. Ive also taken a look at
http://www.mvps.org/access/forms/frm0028.htm
I got 4 tables; Car, Cargroup, Rentaltype, Contract
with these fields:
Car
---------------------
CarNR (Primary Key)
Cargroup
Model
Year
Cargroup
--------------------
Cargroup (Primary Key)
Description
Rentaltype
--------------------
Rentalid (Primary Key)
Cargroup
Rentalprice
Timetype
Contract
---------------------
ContractID (Primary key)
CarNR (related from table car)
Cargroup (related from table cargroup)
Rentalid (related from table rentaltype)
Ive made a query with these fields, and combo boxes of ([Car].[CarNR]) and (
[Rentaltype].[Rentalid]) in a new form. What i want to do is to first set
CarNR, which means [Car].[Cargroup] is set along with it. Then i want to
filter the Rentaltype combo box to only show options where [Rentaltype].
[Cargroup] = [Car].[Cargroup]
This is what ive made out of the CarNR_Afterdupate, combo box:
Private Sub CarNR_AfterUpdate()
Dim strSQL As String
strSQL = "Select " & Me!Cargroup
strSQL = strSQL & " from Rentaltype"
Me!Rentalid.RowSourceType = "Table/Query"
Me!Rentalid.RowSource = strSQL
End Sub
I'm able to set CarNR first, but when i try to pick Rentalid im told to set a
parametervalue for what ever value [Car].[Cargroup] may have. In other words
i cant make it work.
I'm pretty new to the forums so if you have any troubles understanding what
im trying to state please say so.
Thanks alot in advance to any help or tips