By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,493 Members | 1,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,493 IT Pros & Developers. It's quick & easy.

control source based on wheter item iexists in other table

P: n/a
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.
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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?

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.