VBA brain dump

MackMan

Registered User.
Local time
Today, 06:18
Joined
Nov 25, 2014
Messages
174
I know some will laugh, but.. I have an issue I just can't get my head around (must be tired)

Trying to pull information from a text box on double click to populate a combobox on another form...

keeps coming up "type mismatch"


I call lngAccount as recognised on mouseover... ("Business Account" is the value I want)

I can't get it to work!

For info, the form I'm calling from is a subform located FrmMainMenu/FrmAccountsMainMenu and the control source is [Account]

the form I wish to populate in on FrmTransactions (it is a main form only
) and the combobox is cboaccountselect - **I've seen the obvious mistake with no reference to this whatsoever, corrected it, and still not working**
 

Attachments

  • lng.jpg
    lng.jpg
    30.2 KB · Views: 100
what is the rowsource to your cboaccountselect control - the bound column needs to be long.

It is possible you are using lookups in your table design which can cause this sort of error since the datatype presented is often different to the actual datatype
 
The immediate cause of your error is trying to stuff a text value into a variable declared with a numeric data type. Since you say you want the text value, declare the variable as String instead of Long.
 
Thanks! Managed to get the data across using the str Arg. Only one other problem stands in my way...

How to I get the destination combobox to recognise the copied data, and enter it, so I can move on?
 
Hi CJ, thanks for the links. The lower link has proved most valuable over the last few days, but...

I've managed to get the data into the destination combobox no problem, but it's highlighted as if it's been copied but the detination combobox it's sitting in does not recognise the data (even if I press Enter).

both the original location (which is looking up an account name from tblaccounts disaplyed on a form), and the destination location (which is looking up the same account name from the same table, but is an unbound combo box) are using the same values.
However, it's not recognised. Should I be looking up the ID instead?
 

Users who are viewing this thread

Back
Top Bottom