Visible Memo Field

D

dbl

Hi I have a form (IncidentData) with a memo field called InFo. I want this
field to be visible only if there is data recorded in the InFo field. Is
this possible? and if it is how do I go about setting it up?

The InFo field is linked to the IncidentData form through a different table
and then through a qry.

Any help would be very much appreciated.

Thanks Bob
 
G

grep

Hey dbl,

Not sure I understand how data is getting *into* the InFo field, but no
matter. Presuming the value of the memo field is null unless filled, you
could do something like:

Form's OnCurrent Event:

If IsNull(InFo) then
InFo.Visible = False
Else
InFo.Visible = True
End If

grep
 
D

dbl

Hi Grep
The data is entered into the InFo field thorough the Employer table.
Any way I have entered the code below and it puts the first line in red,
what have I left our or am I miss something?

I am pretty new to this so I need lots of help.

Thanks Bob
 
G

grep

Where did you put it? Within the block for the Current event?

When it goes red, there's usually an associated message that pops up.
What's the message?

grep
 
D

dbl

Grep I have played around with it, it now stops with the debug window and
when you click ok it jumps into the at InFo .Visible = True (which it
lines in Yellow).
Yes its in the forms Current Event.
I have copied the code as I have input it below for you to have a look at

Private Sub Form_Current()
If IsNull(InFo) Then
InFo.Visible = False
Else
InFo.Visible = True
End If

End Sub

Hope this helps Bob
PS Thanks for your help.
 
G

grep

Dbl,

That looks right. There must be something more. When it happens, open up
the Immediate Window (it's on one of the menus - I think Debug) and type
?InFo

What does it say?

Is it possible that the field name isn't actually InFo?

grep
 
D

dbl

Hi Grep

In the form field list the field name is InFo

The name displayed in the field in design view is Employer.InFo

In the Employer Table the field name is InFo

When you type "InFo" into the Immediate Window it gives the message
"Expected Sub, Function or Property"

Could it have anything to do with my Form On Load Event Code which is as
follows?

Private Sub Form_Load()
txtFindCustomer.Visible = False
txtFindMsg.Visible = False
txtFindDriverName.Visible = False
txtFinddriverNameMsg.Visible = False
txtFindRegNumber.Visible = False
txtFindRegNumberMsg.Visible = False
txtFindCustomer = ""
txtFindDriverName = ""
txtFindRegNumber = ""

End Sub

Thanks Bob
 

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