Can Access 2007 Do this???

B

Blueliner975

Im new to this so everything that i have so far has been using the wizard not
coding it myself


i have a simple form with 3 tabs so far... i have dates in most of my boxes
on the form... i know how to make the date change color if it is expired or
past due... is there a way that

if date1 is expired i can make it appear on a seperate tab?
 
P

Piet Linden

Im new to this so everything that i have so far has been using the wizardnot
coding it myself

i have a simple form with 3 tabs so far... i have dates in most of my boxes
on the form... i know how to make the date change color if it is expired or
past due... is there a way that

if date1 is expired i can make it appear on a seperate tab?

Use conditional formatting.
 
B

Blueliner975

Ummm ... ok how??? lol... im new to this! thank you for the help... i am
going to try to play around with the conditional formatting and see if i can
figure it out... if anyone knows exactly how to do what im doing more help
would be greatly appreciated

Thanks again
 
J

Jackie L

First of all, conditional formatting on a form will change the field for all
lines in the detail section so hopefully, you are using the single view (not
continuous).

You will need to have the field exist in both places. You will just change
whether or not it is visible. You can use the same type of code as changing
the color except use Visible.

IF Forms!frmMainForm!ExpiredDate > Date then
Forms!frmMainForm!ExpiredDate.Visible = False
Forms!frmMainForm.OtherExpiredDate.Visible = True
Else
Forms!frmMainForm!ExpiredDate.Visible = True
Forms!frmMainForm.OtherExpiredDate.Visible = False
End IF

You will have to work on the syntax if you are using subforms on your tabs.
 
B

Blueliner975

jackie that helps out alot... but if you dont mind taking a minute to break
down that syntax... i have no idea what it means... i understand the concept
of it but

What is Forms! is that just a generic name or is that going to be the name
of my form?

is expireddate an actual command or is it the title of whatever my expired
date might be so if my expired date box is THEDATE would i replace expired
date with THEDATE??

Also where do i edit/add syntax at?

Thank you so much for all your help
 
J

John W. Vinson

First of all, conditional formatting on a form will change the field for all
lines in the detail section

Actually, no, it won't; and it doesn't need any VBA code at all.

If you select a control in form design view and select Format from the menu,
one of the options is "Conditional Formatting". This lets you specify a
criterion on the field value (or enter an expression) and change the color or
visibility or Enabled status of the control based on that value.
 
B

Blueliner975

John thank you for your comment... however... i dont think i can do what i am
trying to do thru the condituional formatting.... please check the original
post and if you know how to do that thru conditional fopormatiing please let
me know !
 
B

Blueliner975

Steve... what is the ME! part... is it going to ME! or is it going to be
something else?
 
J

John W. Vinson

i have a simple form with 3 tabs so far... i have dates in most of my boxes
on the form... i know how to make the date change color if it is expired or
past due... is there a way that

What determines that a date is "expired"? Is that the same as "Past Due" or
not? If a field in the table contains #10/13/2009# how - based on data in your
table - can you determine whether that date is or is not expired?
 
J

John W. Vinson

Steve... what is the ME! part... is it going to ME! or is it going to be
something else?

Me! is just VBA shorthand for "the form that this code is running on".
 
D

David W. Fenton

Me! is just VBA shorthand for "the form that this code is running
on".

Actually, it's VBA shorthand for the object that the code module
that the code is in is attached to. It applies to forms, reports and
standalone class modules (the modules of forms and reports are class
modules, just not standalone ones as they are attached to an Access
object).
 
C

costyh45

ciao
David W. Fenton said:
Actually, it's VBA shorthand for the object that the code module
that the code is in is attached to. It applies to forms, reports and
standalone class modules (the modules of forms and reports are class
modules, just not standalone ones as they are attached to an Access
object).
 

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