On form current problem!

G

Guest

I am having a problem with on Form_Current() procedure on my form. When i
add a the following statements in my Form_Current(), the next navigation
button can be pressed forever therefor allowing blank records. What do I
need to add so that it does not do so.


Private Sub Form_Current()

If Other = True Then
Me.OtherDescription.Enabled = True
Else
Me.OtherDescription.Enabled = False
End If
If Me.CrDecision = "Denied" Then
Me.SetupID.Enabled = True
Else
Me.SetupID.Enabled = False
Me.SetupID = ""
End If
If Me.LoanType = "Vendor" Then
Me.JointVenID.Enabled = True
Else
Me.JointVenID.Enabled = False
Me.JointVenID = ""
End If
end sub
 
T

tina

you're setting the value of certain fields to a zero-length string, which is
presumably what is generating the "blank" records. recommend you open your
*tables* in design view, go to each field of Text, Memo, or Hyperlink data
type, and set the AllowZeroLength property to No. see
http://home.att.net/~california.db/tips.html#aTip6 for more information.

also, suggest you set the code in the Current event to run only on existing
records rather than new records, as

If Not Me.NewRecord Then
If Other = True Then
Me.OtherDescription.Enabled = True
Else
Me.OtherDescription.Enabled = False
End If
If Me.CrDecision = "Denied" Then
Me.SetupID.Enabled = True
Else
Me.SetupID.Enabled = False
Me.SetupID = ""
End If
If Me.LoanType = "Vendor" Then
Me.JointVenID.Enabled = True
Else
Me.JointVenID.Enabled = False
Me.JointVenID = ""
End If
End If

hth
 

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