Connecting Tech Pros Worldwide Forums | Help | Site Map

control source based on wheter item iexists in other table

Bart Lateur
Guest
 
Posts: n/a
#1: Nov 13 '05
In an Access form, I'd like to show the status on whether an item as
entered in a textbox (and thus in its coupled record field) exists in a
list in another table. I've tried:

- Making the record source of the form a query, like

select a.*, b.barcode is not null as [found] from [main table] a
left join barcodes b on a.barcode = b.barcode

but as a result, the form is not updatable

- set the control source of a check box (or text box) which serves as
my flag, to a query:

select count(*) as [found] from barcodes
where barcode = Me![barcode]

but the textbox now shows "#name?", the check box is grey (as if the
contents is null).

What must I do to make it work?

In the end, the idea is to show one of two images depending on this
state, a green checkmark if found and and a red cross if not found. I
can do that by setting one of two images visible and the other
invisible, depending on the value in the checkbox... But: what event
should I put the code in, to make it work reliably?

If anybody can suggest a shortcut, that is welcome, too.

--
Bart.

DaveB
Guest
 
Posts: n/a
#2: Nov 13 '05

re: control source based on wheter item iexists in other table


You could set the control source to nothing and run code that checks
for the barcode and then set the check box to 0 or -1.
Is the form continuous or single?

Closed Thread