Microsoft Access Book Library list boxes programed?
Book Library list boxes programed
I have tables with the following fields
Tablebookmaintable
fields
ID Book
Book Name
Author Number
Catagory
Subcatagory
Extra Catagory
Format
Pages
ISBN
Website
Publisher Number
Publisher Website
Copyright date
picture
Authorname Table
Author ID
Author lastname
Author firstname
Publisher Name Table
Publisher ID
Publisher Name
Number
Form
Same fields as Book Main Table includes
Tablebookmaintable
fields
ID Book
Book Name
Author Number
Catagory
Subcatagory
Extra Catagory
Format
Pages
ISBN
Website
Publisher Number
Publisher Website
Copyright date
picture
Now, please can someone help me out.
The three fields above the forms for the combo boxes I want to cascade or populate are
BookName 1 combo 14
AuthorNameLast combo 16
Publisher Name combo 18
I want to populate book name (combo 14)
and author name combo 16)
I get a combo box 16 error message
Also, here is the coding
Option Compare rel="nofollow">http://www.fontstuff.com/access/acctut10.htm
Regards
Comments
You need to put quotes around the values from your text boxes e.g.
Combo14.RowSource = "Select NamID, AuthorName " & _
"FROM tblAuthorName " & _
"WHERE AuthorType = '" & Combo18.Value & _
"' ORDER BY NamID;"
currently your SQL looks like this:
"Select NamID, AuthorName FROM tblAuthorName WHERE AuthorType = myAuthorType ORDER BY NamID;"
VB will take myAuthorType as a variable and generate an error.
you want it to look like this:
"Select NamID, AuthorName FROM tblAuthorName WHERE AuthorType = 'myAuthorType' ORDER BY NamID;"
You can make life a little easier for yourself in two ways here:
1 - Build up the SQL as a String in a seperate line then you can log/debug it using tools like debug.print
2 - add error handling code after the on error resume next line - currently any errors are ignored. It is better to try and handle them using if err.number then (or whatever the correct object method is)
It depends on or your list box is made on the table or query fields or like value list. In first case you should change items in the table fields, otherwise you should change meanings in Row source in the properties of list box.