COMBOBOX Afterupdate problem

jmsjazz

Registered User.
Local time
Today, 18:51
Joined
Mar 19, 2013
Messages
43
Hi - this sounds like it should be simple but I can't make it work:
I have 2 tables, joined in a query to populate a form.
TblPOI has Userid, POINAME, EMAIL (e.g. JMS, John, myemailaddress)
tblINCIDENTS has among other fields POI, IC (POI links to UserID). I want IC to update to POINAME when I select the userID in a combobox.

FormINCIDENTS has POI as a combobox which displays and allows me to select the Userid and populate the table with POI. For the source I used: SELECT Userid, POI, POIName FROM tblPOI; I bound column 1.

I created a text box (named "ICbox") on the form to display the POINAME after selecting POI, but it doesn't appear.

I tried using AFTERUPDATE event and typing me.ICbox.value=me.POI.COLUMN(3), but it a) doesn't show on the form and b) doesn't update tblINCIDENTS

Any help appreciated!
 
Hello jmsjazz, Welcome to AWF.. :)

Is your ICbox bound to the field you are trying to UPDATE? Which raises the question, why the need to copy the field data that is related on to this new table? What is the relationship between tblPOI and tblINCIDENTS?
 
If this is correct

SELECT Userid, POI, POIName FROM tblPOI

there are only three Fields, so you cannot have a Column with the Index of 3!

me.POI.COLUMN(3)

The Index is Zero-based, i.e

Column 1 would be me.POI.COLUMN(0)
Column 2 would be me.POI.COLUMN(1)
Column 3 would be me.POI.COLUMN(2)


Linq ;0)>
 
Thanks both
Missinglinq: thanks for spotting that - I changed it but it still doesn't update

PR2:tblPOI and tblIncidents are linked on UserID<>POI. I originally had ICbox bound to POINAME, but when I changed POI on the form, it didn't show the name (POINAME) in ICbox, and deleted the name POINAME from tblPOI. I thne made ICbox unbound, but still no luck
 
Can you post the entire AfterUpdate event where you attempt to assign the data from the Combobox to the Textbox?

Even better would be zipping up the file and attaching it here, removing any confidential information.

Linq ;0)>
 
Thanks Missinglinq. Attached is the file - it now nearly works (the name appears in the textbox but after 1 or 2 updates I am told Index cannot be empty)
You will see on my form the next stage is to send an email to the person I select (I wil cross that bridge if I reach the river!)
 

Attachments

Users who are viewing this thread

Back
Top Bottom