saleemMSMS
Registered User.
- Local time
- Today, 19:36
- Joined
- Aug 12, 2009
- Messages
- 92
i have 2 tables
Book (BookID, Title, Price, Author)
Magazine (magID, Title, Edition, Publisher)
also i have an Order Table
Order (OrderID, Book/MagType, Book/MagID, DateTime)
i created a form for the Order form using the wizard and then added a combo box to the Book/MagType Column. (replaced the text box witha combo box and bounded it with the Book/MagType Field) (named ComboType)
also i got another combo box for the Book/MagID field. (named ComboID) the content of this combo is supposed to change according to the selection of ComboType.
so i coded the following in the ComboType AfterUpdate Event
please note that the row source property of ComboType is not defined properties page since it has to be changed in the runtime as the code says..
this code works without any problem.
but.. when I re-open the form, all the columns except the ComboID are filled with the respective saved data..
my question is how can i fill the ComboType Column too when i'm viewing existing data. ?
Book (BookID, Title, Price, Author)
Magazine (magID, Title, Edition, Publisher)
also i have an Order Table
Order (OrderID, Book/MagType, Book/MagID, DateTime)
i created a form for the Order form using the wizard and then added a combo box to the Book/MagType Column. (replaced the text box witha combo box and bounded it with the Book/MagType Field) (named ComboType)
also i got another combo box for the Book/MagID field. (named ComboID) the content of this combo is supposed to change according to the selection of ComboType.
so i coded the following in the ComboType AfterUpdate Event
Code:
Private Sub ComboType_AfterUpdate()
Me. ComboID.SetFocus
Select Case ComboType
Case "Book"
Me. ComboID.RowSource = "Select BookID from Book"
Case "Magazine"
Me. ComboID.RowSource = "Select magID from Magazine"
End Select
Me. ComboID.Dropdown
End Sub
please note that the row source property of ComboType is not defined properties page since it has to be changed in the runtime as the code says..
this code works without any problem.
but.. when I re-open the form, all the columns except the ComboID are filled with the respective saved data..
my question is how can i fill the ComboType Column too when i'm viewing existing data. ?