continuous forms

B

Bart Pannemans

hello,

I'm bit vexed by some of the characteristics of continuous forms. Two small
problems to illustrate it.

-> imagine a continuous form showing all customers accounts. It has a input
textfield 'credit' which values could be positive or negative. Now I want
the background color of this field to be red or green accordingly, so as to
give a good overview. No problem doing this with event 'oncurrent'
(me.txtcredit.backcolor =...), but then all credit-fields will change to the
same color.

-> a continuous form with all billed expenses has the fields 'customer' and
'project'. Expenses are billed to a project, and a customer can have several
projects. The two are shown in linked comboboxes, i.e. when the appropriate
customer is selected in the first combobox 'cmbcust', all projects of that
customer are queried from a tabel 'projects' and then shown in the combobox
'cmbproj'. Another extra information, both comboboxes work with ID's
'customerID', 'projectID' ,but show the full name of the customer, project
(two columns per combobox, one hidden with ID, and a second with full name).
Now the problem: when I select a customer in the current record, all
projectcomboboxes in all records will show only the projects of that
customer. Because the projectID in other records are mostly not among the
ones selected (because a different customer), the cmbproj-field will show
empty (of course there is still a value).

I realize this has to do with the nature of properties of the controls on
continuous forms, but can anybody give me a good work-around for this
problem.

Thanks

Bart Pannemans
 
D

Douglas J. Steele

Answers in-line.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Bart Pannemans said:
hello,

I'm bit vexed by some of the characteristics of continuous forms. Two
small
problems to illustrate it.

-> imagine a continuous form showing all customers accounts. It has a
input
textfield 'credit' which values could be positive or negative. Now I want
the background color of this field to be red or green accordingly, so as
to
give a good overview. No problem doing this with event 'oncurrent'
(me.txtcredit.backcolor =...), but then all credit-fields will change to
the
same color.

Assuming you're using Access 2000 or newer, look into Conditional
Formatting.

Prior to that, take a look at http://www.mvps.org/access/forms/frm0024.htm
at "The Access Web"

-> a continuous form with all billed expenses has the fields 'customer'
and
'project'. Expenses are billed to a project, and a customer can have
several
projects. The two are shown in linked comboboxes, i.e. when the
appropriate
customer is selected in the first combobox 'cmbcust', all projects of that
customer are queried from a tabel 'projects' and then shown in the
combobox
'cmbproj'. Another extra information, both comboboxes work with ID's
'customerID', 'projectID' ,but show the full name of the customer, project
(two columns per combobox, one hidden with ID, and a second with full
name).
Now the problem: when I select a customer in the current record, all
projectcomboboxes in all records will show only the projects of that
customer. Because the projectID in other records are mostly not among the
ones selected (because a different customer), the cmbproj-field will show
empty (of course there is still a value).

I believe there is a solution for this problem, but I'm afraid I don't
remember it at the moment. Hopefully someone else will chime in with the
answer. In the meantime, you could try using a subform.
 
B

bart pannemans

conditional formating seems fine, but for the comboboxes, access does not
allow subforms in continuous forms. Lets hope someone remembers that
solution :)

But thanks

Bart Pannemans
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top