dibblermail
Member
- Local time
- Today, 00:32
- Joined
- Jan 10, 2025
- Messages
- 64
Please can someone put me out of my misery. This cant be as hard as I'm making it.
I've looked at old posts and nothing I've tried from them seems to work, so I'm not understanding something, or I'm looking straight through something.
I have a combo box with 1 column in it. But it also pulls in its Key (ClientID)
Column1 = ClientID
Column2 = ClientName
I don't want the end user to ever see the Client ID, Its just there as the key so it's irrelevant & confusing to that end user.
This form is used to display existing records & for adding new
When adding new & want to be able to see all the old client names in the drop down (obviously no point retyping it). But I also need to be able to add a new name
I can get it to show just the ClientName when I load the form & when I click in it to show the dropdown.
But no matter what I do, the end value displayed after selection is always the Client ID.
Ive tried these 2 to correct it (obviously 1 at a time).
but they both give me an error 2115 - Macro or function set to beforeupdate is preventing save (paraphrasing)
presumably this is because the ClientName is being saved into ClientID which is not viable.
What's the normal work around, this seems like such a simple thing to need, but it's solution is really eluding me.
I've looked at old posts and nothing I've tried from them seems to work, so I'm not understanding something, or I'm looking straight through something.
I have a combo box with 1 column in it. But it also pulls in its Key (ClientID)
Column1 = ClientID
Column2 = ClientName
I don't want the end user to ever see the Client ID, Its just there as the key so it's irrelevant & confusing to that end user.
This form is used to display existing records & for adding new
When adding new & want to be able to see all the old client names in the drop down (obviously no point retyping it). But I also need to be able to add a new name
I can get it to show just the ClientName when I load the form & when I click in it to show the dropdown.
But no matter what I do, the end value displayed after selection is always the Client ID.
Ive tried these 2 to correct it (obviously 1 at a time).
Code:
Private Sub CBOX_ClientName_AfterUpdate()
CBOX_ClientName.Text = CBOX_ClientName.Column(1)
CBOX_ClientName.Text = CBOX_ClientName.Column(0) & " " & CBOX_ClientName.Column(1)
End Sub
but they both give me an error 2115 - Macro or function set to beforeupdate is preventing save (paraphrasing)
presumably this is because the ClientName is being saved into ClientID which is not viable.
What's the normal work around, this seems like such a simple thing to need, but it's solution is really eluding me.