
Originally Posted by
IamKJVonly
I can't seem to follow instructions very well as I can't figure out how to attach a file so that option is out.
Detailed instructions to attach a file to a reply":
1. Make a copy of your dB
2. Open the dB
3. Do a "Compact and Repair"
4. Close the dB
5. Compress (Zip) the dB. If you don't have Win Zip or a program like it, right click on the copy of the dB and select "Send To". In the next dialog box, select "Compressed (zipped) folder.
6. In your thread, create a reply.
7. Below the reply box, click in "Go Advanced"
8. Scroll down until you see "Manage Attachments". Follow the prompts.
--------------------------------------------------------------
So there are a couple of things to look at.
In the list box, you have set the Row Source to:
Code:
SELECT [ContactTable].[ContactID], [ContactTable].[ContactName], [ContactTable].[DateLastUsed]
FROM ContactTable
ORDER BY [ContactName];
There are 3 COLUMNS in the list box.
First column is [ContactTable].[ContactID]
Second column is [ContactTable].[ContactName] (more on this column later)
Third column is [ContactTable].[DateLastUsed]
Most controls have a default PROPERTY. The default PROPERTY for a List/Combo box is the Value property. (Not the same as a control Default Value)
Now, in the list box, if you set the BOUND COLUMN to 1, and you refer to the list box like
the value that is returned is the value in the row selected of the first column (in this case the ContactID column). Note that the BOUND COLUMN property is one (1) based.
If you set the BOUND COLUMN to 2, and run the code above, the value that is returned is the value in the row selected of the second column (in this case the ContactName column)
If you set the BOUND COLUMN to 3, and run the code above, the value that is returned is the value in the row selected of the thirdcolumn (in this case the DateLastUsed column)
This means that the combo box doesn't know from Sxxt from shinola about field names.
Which is why you get the error

Originally Posted by
IamKJVonly
Note: I'm getting the following error message on "="Contact_ID=" & [Contact_ID]" when I run it:
The object doesn’t contain the Automation object “[Contact_ID.”
You tried to run a Visual Basic procedure to set a property or method for an object. However the component doesn’t make the propery or method available for Automation operation.
So you cannot have a WHERE string/clause like
"Contact_ID=" & [Forms]![frm_AllContacts]!
[List0]![
Contact_ID]
You MUST use the Column property.
"Contact_ID=" & [Forms]![frm_AllContacts]!
[List0].
Column(0)
Note that the column property is zero (0) based.
On the "Format" tab of Property Sheet of the combo box, is the "Column Count". It is also one (1) based.
If you DO NOT want to see the "ContactID" in the list box set the "Column Widths" property to zero to hide the column [Contact_ID].
I would suggest that you set both the BOUND COLUMN property to 0 (zero) and the Column Widths property to 0 (zero).
-----------------------------------------------------------------------------
OK, its later. I recomment that you split the "ContactName" field into "ContactFirstName" and "ContactLastName". If you need to have the full name, you can always concatenate them. Plus, you can sort the names by Last Name,First Name.
Code:
SELECT ContactTable.ContactID, [ContactTable].[ContactLastName] & ", " & [ContactTable].[ContactFirstName] AS Fullname, ContactTable.DateLastUsed
FROM ContactTable
ORDER BY [ContactTable].[ContactLastName] & ", " & [ContactTable].[ContactFirstName];
Maybe you would post the code for the List box Click event?