How to stop table content being renamed via combobox

MCCDOM

Registered User.
Local time
Today, 13:16
Joined
Oct 30, 2014
Messages
84
Hi There,

I have a really simple form whereby you chose an option from a combobox and it populates the 3 textboxes below with the matching data in the table. Now every time I select an option from the combobox it renames the field of data in the table with a number. By the looks if it, it is using the primary key of the last selected item.

This is the code I am using for the combobox to fill the textboxes which are bound to the table.
Code:
DoCmd.ApplyFilter "", "[WebsitePasswordID] Like ""*"" & [Forms]![frmWebsite]![cboWebsiteName] & ""*""", ""

Any ideas on what might be causing this and how to fix it please?

Many thanks,

Dom
 
Tell us more about your table and fields.
 
Table is called tblWebsitePasswords. Within the table I have 5 columns: WebsitePasswordID, WebsiteName, URL, Username and Password. On the form the combobox displays the website name and you can select one which in turn updates the below 3 textboxes: URL, Username and Password to show the related information. The data that gets overwritten is WebsiteName.
 
Minty I ran the combobox wizard and asked it to populate the combobox from the table wizard if that's what you mean by lookup field?
 
Nope don't think so.
What is the forms recordsource set to ?
 
The forms recordsource is set to tblWebsitePassword.
 
That's why then. I would place a small bet that your control that "Displays" the websitename has its control source set to the website name...
 
Hi Minty, you would be correct with the control source for the website name combobox being set to websitename. What would you suggest I change this to please?
 
Simply remove the control source. You just want an unbound text or combobox for display purposes. You are currently applying a filter to your actual stored table values.
 
Perfect works like a charm. Thank you very much.
 

Users who are viewing this thread

Back
Top Bottom