Pasting into a combo box

Mark Wild

Registered User.
Local time
Today, 22:39
Joined
Apr 9, 2003
Messages
126
On one of my data input forms, I allow the user to “copy” the details from the previous piece of input, which they can see, as well as the option to use combo boxes

for example, they may select town and county from the previous input, but select a new road from a combo box.

I can move the information into the combos, but I get the error msg “The value you have entered is not valid”. If I use the combo box arrows the data is correct, but it seems that I have to actually pull the record off the list for it to be accepted.

Is there anyway to refresh/requery the combo so that the data is accepted when pasted in?
 
How are you moving the information into the combo boxes?
 
me.CbfieldName=forms!FrmLastInput.fieldName
me.cbfieldName.requery
 
Can you give me an example of the control source for the combo box that you are trying to paste into? And an example of the data you are pasting in? Are you sure the data is the same format and the proper type?

For example, your combo box might be displaying town names, but the control source might actually be a number field.
 
Cheers dcx693.

I'm working at a different client site at the moment, so I can' see my original db , but I just treid to throw an example together to show you the problem...only it didn't arise.

I'll go back ot basics and check again for where the problem might be coming from.

thanks for your help and I'll continue the post if the problem still arises.

M
 
Thought I might have over simplified my problem.

The combo boxes are 2 columns, 1 is bound and 2 contains the visible text.

Each combo box is set up to replicate normalised tables. Col 1 =id, col 2 =text.

Therefore, when I copy the old record back into the combo box, it is only taking the text value, not the bound ID number.

I've tried concantonating the id and text and pasting them into the combo box, but still no luck.

Any suggestions how I can copy the required values across?

Thanks,

M
 
I thought you might have multi-column combo boxes. They should be no problem, though.

The only value you need to pass from the old boxes to the news ones is the bound value. In this case, the ID number. Do not pass additional values to the new combo boxes because they won't produce the desired result. Although your combo box displays two columns, it will only store one - the bound value. So when you pass anything but an ID number over it won't match anything in the combo box because it's not a plain ID number.
 
DCX,

Cheers, have noe got it working. On the sub form I kept the text field but added the ID field in a non visible text box. It is this that I move into the combo box and all is good.

Cheers,

M
 

Users who are viewing this thread

Back
Top Bottom