View Full Version : Help with coding


Poss
04-23-2008, 04:02 AM
Hi all,

I'm not crash hot at coding but would like to have a go at it and would like some guidance.

I have a database with 3 tables described below:

Table1: Products
ProductID (PK:autonumber)
Product_Number (number)
Product_Name (text)
Manufactured_Year (number)
Brand (text)

Table2: Version
VersionID (PK:autonumber)
Version_Description (text)

Table3: Product Version
ProductVersionID
ProductID
VersionID
Version_Availability (yes/no checkbox)

Table relationships:
1 product can have many versions
1 version can have only one availability

I've also got a front end form with the following controls:

-Product Name combo box (populated via SQL in row source property)
-Product Number combo box (populated via SQL in row source property)
-Manufactured Year combo box (manually populated)
-5 labels which describe the version description in text
-5 checkboxes (1 for each label). Checked means version is available. Unchecked means it's unavailable.
- Save button.

I want to be able to select a product name from the combo box on the form, select a year of manufacture then check the checkboxes next to the labels where the version is available, then click Save and everything gets saved in the database.

Thanks in advance for all help and guidance

George Too
04-23-2008, 04:57 AM
Seems to me that the only thing that changes is the availability of the product you are selecting. If that is the case then create a query, bind your form to that query and every time you check the boxes the record will be updated.

If you want to have a bit more difficult, which is where I think I missed the point in my first post you will need to open the recordset, save each check box value. This code goes on the OnClick event of the Save button

Poss
04-23-2008, 02:44 PM
I also need to update the year of manufacture so when i save the record, it'll write the year of manufacture into the database.