Dummy text box on user form (1 Viewer)

JeremyH

New member
Local time
Tomorrow, 01:27
Joined
Jul 30, 2019
Messages
9
Hi all...

I have been struggling to get a text box to display the correct concatenated string of data

Form Fields:
SO_ID - for my job number from my SO_Main table
Customer - Customer Name from my customer table
Purchase Order - PO number.

I have concatenated these fields in my SO_Main query and i get the result

When i add the text box and add the link to my query field as the control data source I get #Name?

What am I doing wrong?

Thank you
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 06:27
Joined
May 7, 2009
Messages
19,230
your SO_MAIN query:

select SO_ID, CUSTOMER, [Purchase Order], ([SO_ID] & [Customer] & [Purchase Order]) As SOCustPO from yourTable;

use this query as the recordsource of your form and add all the fields to the form. you don't need to link anything.
 

JeremyH

New member
Local time
Tomorrow, 01:27
Joined
Jul 30, 2019
Messages
9
on my SO_Main Query
SOCusPO: "Job No. " & [SO_ID] & ", Customer " & [CUSTOMER] & ", PO No. " & [PURCHASE ORDER]

Result in Query table:
Job No. 74018, Customer INHEP ELECTRONICS HOLDINGS (PTY) LTD, PO No. 12345

But it is still not displaying in the form correctly
 

isladogs

MVP / VIP
Local time
Today, 23:27
Joined
Jan 14, 2017
Messages
18,212
Doesn't display correctly isn't helpful.
What do you see on the form instead?
 

JeremyH

New member
Local time
Tomorrow, 01:27
Joined
Jul 30, 2019
Messages
9
Doesn't display correctly isn't helpful.
What do you see on the form instead?
it displays #Name?


Maybe I should concatenate the fields in a macro?

I want to use the concatenated string in my email subject line when I use the SendObject command

Apologies for the fragment bits of info (multi-tasking day is not working for me today)
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 06:27
Joined
May 7, 2009
Messages
19,230
what is not showing correctly? are there missing info like:

[SO_ID] not yet entered.
[PURCHASE ORDER] not yet entered.

Code:
SOCusPO: ("Job No. " + [SO_ID]) + ", ") & "Customer " + [CUSTOMER]) & (", PO No. " & [PURCHASE ORDER])
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 06:27
Joined
May 7, 2009
Messages
19,230
your Textbox Name is same as your Field Name.
try adding prefix to the textbox name, eg:

txtSOCusPO
 

isladogs

MVP / VIP
Local time
Today, 23:27
Joined
Jan 14, 2017
Messages
18,212
No need for a macro

#Name error normally indicates one or more required fields are missing. Check and add to record source if necessary.

Or enter the concatenated expression as the control’s record source.

If both the above fail the form may be corrupted


Sent from my iPhone using Tapatalk
 

JeremyH

New member
Local time
Tomorrow, 01:27
Joined
Jul 30, 2019
Messages
9
what is not showing correctly? are there missing info like:

[SO_ID] not yet entered.
[PURCHASE ORDER] not yet entered.

Code:
SOCusPO: ("Job No. " + [SO_ID]) + ", ") & "Customer " + [CUSTOMER]) & (", PO No. " & [PURCHASE ORDER])

Fixed

the coded string works. Thanks you so much.
 

JeremyH

New member
Local time
Tomorrow, 01:27
Joined
Jul 30, 2019
Messages
9
No need for a macro

#Name error normally indicates one or more required fields are missing. Check and add to record source if necessary.

Or enter the concatenated expression as the control’s record source.

If both the above fail the form may be corrupted


Sent from my iPhone using Tapatalk

Thank you for your input. :)
 

Users who are viewing this thread

Top Bottom