Forms in Access, Fill a text field if it is left blank

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I would like to know how can I highlight a field with a bright coulour
automatically if it is left blank , so that the next time the database is
opened, so we know that the field has to be filled.
If my form is named "Employee"
Field is labeled "Mgr Signature"
Control Source is "Mgr Signature"
Also in which property should I enter the macro, for eg. under " On Click",
On Enter" etc......
PLEASE HELPPPPPPP!!!!!!!!!!!
Thanks.
 
It should be on the OnCurrent of the form.

If Forms!Employee![Mgr Signature] = "" then


or set the format property to be

@;"Please Fill In"
 
Hi,
I did not understand your message???I am new at this as you can tell.

So what should the Statements for the macro if I want to fill the textbox
with RED if it is left BLANK.
Thanks.

JohnFol said:
It should be on the OnCurrent of the form.

If Forms!Employee![Mgr Signature] = "" then


or set the format property to be

@;"Please Fill In"



FC said:
Hi,
I would like to know how can I highlight a field with a bright coulour
automatically if it is left blank , so that the next time the database is
opened, so we know that the field has to be filled.
If my form is named "Employee"
Field is labeled "Mgr Signature"
Control Source is "Mgr Signature"
Also in which property should I enter the macro, for eg. under " On
Click",
On Enter" etc......
PLEASE HELPPPPPPP!!!!!!!!!!!
Thanks.
 
Private Sub Form_Current()

Forms!Employee![Mgr Signature].backcolor = 16777215 'DarkGrey or change to
whatever you want
If Forms!Employee![Mgr Signature] = "" or isnull(Forms!Employee![Mgr
Signature]) then Forms!Employee![Mgr Signature].backcolor = 255

End Sub


Stick this in NWind Orders Form to see it working

Private Sub Form_Current()

If Me.ShipRegion = "" Or IsNull(Me.ShipRegion) Then Me.ShipRegion.BackColor
= 255 Else Me.ShipRegion.BackColor = 16777215

End Sub


FC said:
Hi,
I did not understand your message???I am new at this as you can tell.

So what should the Statements for the macro if I want to fill the textbox
with RED if it is left BLANK.
Thanks.

JohnFol said:
It should be on the OnCurrent of the form.

If Forms!Employee![Mgr Signature] = "" then


or set the format property to be

@;"Please Fill In"



FC said:
Hi,
I would like to know how can I highlight a field with a bright coulour
automatically if it is left blank , so that the next time the database
is
opened, so we know that the field has to be filled.
If my form is named "Employee"
Field is labeled "Mgr Signature"
Control Source is "Mgr Signature"
Also in which property should I enter the macro, for eg. under " On
Click",
On Enter" etc......
PLEASE HELPPPPPPP!!!!!!!!!!!
Thanks.
 
Hi JohnFol,

I am still having problems. the statements enteredin Event procedure is as
follows
Private Sub Form_Current()
If Forms!SleepLabQC![Night Tech Reviewed] = "" Then
Forms!SleepLabQC![Night Tech Reviewed].BackColor = 255
End SubI get a run time error"2424" when I open the form and the explanation
is that "Expression u enetered has a field, control or property name that
Microsoft Access can't find."

Waiting for your reply.
Thanks.


JohnFol said:
Private Sub Form_Current()

Forms!Employee![Mgr Signature].backcolor = 16777215 'DarkGrey or change to
whatever you want
If Forms!Employee![Mgr Signature] = "" or isnull(Forms!Employee![Mgr
Signature]) then Forms!Employee![Mgr Signature].backcolor = 255

End Sub


Stick this in NWind Orders Form to see it working

Private Sub Form_Current()

If Me.ShipRegion = "" Or IsNull(Me.ShipRegion) Then Me.ShipRegion.BackColor
= 255 Else Me.ShipRegion.BackColor = 16777215

End Sub


FC said:
Hi,
I did not understand your message???I am new at this as you can tell.

So what should the Statements for the macro if I want to fill the textbox
with RED if it is left BLANK.
Thanks.

JohnFol said:
It should be on the OnCurrent of the form.

If Forms!Employee![Mgr Signature] = "" then


or set the format property to be

@;"Please Fill In"



Hi,
I would like to know how can I highlight a field with a bright coulour
automatically if it is left blank , so that the next time the database
is
opened, so we know that the field has to be filled.
If my form is named "Employee"
Field is labeled "Mgr Signature"
Control Source is "Mgr Signature"
Also in which property should I enter the macro, for eg. under " On
Click",
On Enter" etc......
PLEASE HELPPPPPPP!!!!!!!!!!!
Thanks.
 
If IsNull(Me![Night Tech Reviewed]) Then
Me![Night Tech Reviewed].BackColor = vbred

Chris
-----Original Message-----
Hi JohnFol,

I am still having problems. the statements enteredin Event procedure is as
follows
Private Sub Form_Current()
If Forms!SleepLabQC![Night Tech Reviewed] = "" Then
Forms!SleepLabQC![Night Tech Reviewed].BackColor = 255
End SubI get a run time error"2424" when I open the form and the explanation
is that "Expression u enetered has a field, control or property name that
Microsoft Access can't find."

Waiting for your reply.
Thanks.


JohnFol said:
Private Sub Form_Current()

Forms!Employee![Mgr Signature].backcolor = 16777215 'DarkGrey or change to
whatever you want
If Forms!Employee![Mgr Signature] = "" or isnull(Forms!Employee![Mgr
Signature]) then Forms!Employee![Mgr Signature].backcolor = 255

End Sub


Stick this in NWind Orders Form to see it working

Private Sub Form_Current()

If Me.ShipRegion = "" Or IsNull(Me.ShipRegion) Then Me.ShipRegion.BackColor
= 255 Else Me.ShipRegion.BackColor = 16777215

End Sub


FC said:
Hi,
I did not understand your message???I am new at this as you can tell.

So what should the Statements for the macro if I want to fill the textbox
with RED if it is left BLANK.
Thanks.

:

It should be on the OnCurrent of the form.

If Forms!Employee![Mgr Signature] = "" then


or set the format property to be

@;"Please Fill In"



Hi,
I would like to know how can I highlight a field with a bright coulour
automatically if it is left blank , so that the next time the database
is
opened, so we know that the field has to be filled.
If my form is named "Employee"
Field is labeled "Mgr Signature"
Control Source is "Mgr Signature"
Also in which property should I enter the macro, for eg. under " On
Click",
On Enter" etc......
PLEASE HELPPPPPPP!!!!!!!!!!!
Thanks.
.
 
Hi Chris,
What is "Me" ?
If my form name is "Sleep Lab", Field label is"Night Tech Reviewed"and
control source is the same.
So do I right click on the Night Tech Reviewed Text box in design view then
go to ON ENTER and select event procedure? Pls Help!!!!!
Thanks


Chris Reveille said:
If IsNull(Me![Night Tech Reviewed]) Then
Me![Night Tech Reviewed].BackColor = vbred

Chris
-----Original Message-----
Hi JohnFol,

I am still having problems. the statements enteredin Event procedure is as
follows
Private Sub Form_Current()
If Forms!SleepLabQC![Night Tech Reviewed] = "" Then
Forms!SleepLabQC![Night Tech Reviewed].BackColor = 255
End SubI get a run time error"2424" when I open the form and the explanation
is that "Expression u enetered has a field, control or property name that
Microsoft Access can't find."

Waiting for your reply.
Thanks.


JohnFol said:
Private Sub Form_Current()

Forms!Employee![Mgr Signature].backcolor = 16777215 'DarkGrey or change to
whatever you want
If Forms!Employee![Mgr Signature] = "" or isnull(Forms!Employee![Mgr
Signature]) then Forms!Employee![Mgr Signature].backcolor = 255

End Sub


Stick this in NWind Orders Form to see it working

Private Sub Form_Current()

If Me.ShipRegion = "" Or IsNull(Me.ShipRegion) Then Me.ShipRegion.BackColor
= 255 Else Me.ShipRegion.BackColor = 16777215

End Sub


Hi,
I did not understand your message???I am new at this as you can tell.

So what should the Statements for the macro if I want to fill the textbox
with RED if it is left BLANK.
Thanks.

:

It should be on the OnCurrent of the form.

If Forms!Employee![Mgr Signature] = "" then


or set the format property to be

@;"Please Fill In"



Hi,
I would like to know how can I highlight a field with a bright coulour
automatically if it is left blank , so that the next time the database
is
opened, so we know that the field has to be filled.
If my form is named "Employee"
Field is labeled "Mgr Signature"
Control Source is "Mgr Signature"
Also in which property should I enter the macro, for eg. under " On
Click",
On Enter" etc......
PLEASE HELPPPPPPP!!!!!!!!!!!
Thanks.
.
 
Me is the current object in focus. It is used instead of
the name of the form, report...

Chris
-----Original Message-----
Hi Chris,
What is "Me" ?
If my form name is "Sleep Lab", Field label is"Night Tech Reviewed"and
control source is the same.
So do I right click on the Night Tech Reviewed Text box in design view then
go to ON ENTER and select event procedure? Pls Help!!!!!
Thanks


Chris Reveille said:
If IsNull(Me![Night Tech Reviewed]) Then
Me![Night Tech Reviewed].BackColor = vbred

Chris
-----Original Message-----
Hi JohnFol,

I am still having problems. the statements enteredin Event procedure is as
follows
Private Sub Form_Current()
If Forms!SleepLabQC![Night Tech Reviewed] = "" Then
Forms!SleepLabQC![Night Tech Reviewed].BackColor = 255
End SubI get a run time error"2424" when I open the form and the explanation
is that "Expression u enetered has a field, control or property name that
Microsoft Access can't find."

Waiting for your reply.
Thanks.


:

Private Sub Form_Current()

Forms!Employee![Mgr Signature].backcolor = 16777215 'DarkGrey or change to
whatever you want
If Forms!Employee![Mgr Signature] = "" or isnull(Forms!Employee![Mgr
Signature]) then Forms!Employee![Mgr Signature].backcolor = 255

End Sub


Stick this in NWind Orders Form to see it working

Private Sub Form_Current()

If Me.ShipRegion = "" Or IsNull(Me.ShipRegion) Then Me.ShipRegion.BackColor
= 255 Else Me.ShipRegion.BackColor = 16777215

End Sub


Hi,
I did not understand your message???I am new at this as you can tell.

So what should the Statements for the macro if I want to fill the textbox
with RED if it is left BLANK.
Thanks.

:

It should be on the OnCurrent of the form.

If Forms!Employee![Mgr Signature] = "" then


or set the format property to be

@;"Please Fill In"



Hi,
I would like to know how can I highlight a field with a bright coulour
automatically if it is left blank , so that the next time the database
is
opened, so we know that the field has to be filled.
If my form is named "Employee"
Field is labeled "Mgr Signature"
Control Source is "Mgr Signature"
Also in which property should I enter the macro, for eg. under " On
Click",
On Enter" etc......
PLEASE HELPPPPPPP!!!!!!!!!!!
Thanks.









.
.
 
Click on the top left box of the form in design view. then
go to the OnCurrent event to put the code in. I don't
think you want the back color of the field label but the
actual field(control source).

Chris
-----Original Message-----
Hi Chris,
What is "Me" ?
If my form name is "Sleep Lab", Field label is"Night Tech Reviewed"and
control source is the same.
So do I right click on the Night Tech Reviewed Text box in design view then
go to ON ENTER and select event procedure? Pls Help!!!!!
Thanks


Chris Reveille said:
If IsNull(Me![Night Tech Reviewed]) Then
Me![Night Tech Reviewed].BackColor = vbred

Chris
-----Original Message-----
Hi JohnFol,

I am still having problems. the statements enteredin Event procedure is as
follows
Private Sub Form_Current()
If Forms!SleepLabQC![Night Tech Reviewed] = "" Then
Forms!SleepLabQC![Night Tech Reviewed].BackColor = 255
End SubI get a run time error"2424" when I open the form and the explanation
is that "Expression u enetered has a field, control or property name that
Microsoft Access can't find."

Waiting for your reply.
Thanks.


:

Private Sub Form_Current()

Forms!Employee![Mgr Signature].backcolor = 16777215 'DarkGrey or change to
whatever you want
If Forms!Employee![Mgr Signature] = "" or isnull(Forms!Employee![Mgr
Signature]) then Forms!Employee![Mgr Signature].backcolor = 255

End Sub


Stick this in NWind Orders Form to see it working

Private Sub Form_Current()

If Me.ShipRegion = "" Or IsNull(Me.ShipRegion) Then Me.ShipRegion.BackColor
= 255 Else Me.ShipRegion.BackColor = 16777215

End Sub


Hi,
I did not understand your message???I am new at this as you can tell.

So what should the Statements for the macro if I want to fill the textbox
with RED if it is left BLANK.
Thanks.

:

It should be on the OnCurrent of the form.

If Forms!Employee![Mgr Signature] = "" then


or set the format property to be

@;"Please Fill In"



Hi,
I would like to know how can I highlight a field with a bright coulour
automatically if it is left blank , so that the next time the database
is
opened, so we know that the field has to be filled.
If my form is named "Employee"
Field is labeled "Mgr Signature"
Control Source is "Mgr Signature"
Also in which property should I enter the macro, for eg. under " On
Click",
On Enter" etc......
PLEASE HELPPPPPPP!!!!!!!!!!!
Thanks.









.
.
 
Back
Top