Required Field

  • Thread starter Thread starter Sharon
  • Start date Start date
S

Sharon

Somehow, sometime, I have managed to create a form that is
requiring me to input data into a field. Now that I want
to remove this feature, I can't find out where to do
this. I went to the field in the table and there is no
validation rules and the required field is set to no.
Where else might I look?
 
Check the validation rule for the field on the form. It may not match what
is in the table (as that is only used as the default when you add the field
to a form).

Is this table in a one-to-one relationship with another table? Is the field
mentioned involved in that relationship?

Check your vba code behind the form.

What does the error say?


Rick B



Somehow, sometime, I have managed to create a form that is
requiring me to input data into a field. Now that I want
to remove this feature, I can't find out where to do
this. I went to the field in the table and there is no
validation rules and the required field is set to no.
Where else might I look?
 
This is the code:


Private Sub Text276_DblClick(Cancel As Integer)
Dim strSQL As String

gintAttorneyID = -1

DoCmd.DoMenuItem acFormBar, acRecordsMenu,
acSaveRecord, , acMenuVer70

DoCmd.OpenForm "subfrmAttorney", acNormal, , , ,
acDialog

If gintAttorneyID <> -1 Then
If DCount("*", "lnktblATTORNEYWMA", "WMANo='" &
Me.txtWMANo & "'") > 0 Then
strSQL = "UPDATE lnktblATTORNEYWMA Set
AttorneyID = " & _
gintAttorneyID & " WHERE WMANo = '" &
Me.txtWMANo & "';"
Else
strSQL = "INSERT INTO lnktblATTORNEYWMA
(AttorneyID,WMANo) Values(" & _
gintAttorneyID & ",'" &
Me.txtWMANo & "');"
End If

DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True
End If

Me.Text276.Requery
End Sub
 
And?

You have not told us what error you are getting, which field is being
required? What are the circumstances?

Rick B

This is the code:


Private Sub Text276_DblClick(Cancel As Integer)
Dim strSQL As String

gintAttorneyID = -1

DoCmd.DoMenuItem acFormBar, acRecordsMenu,
acSaveRecord, , acMenuVer70

DoCmd.OpenForm "subfrmAttorney", acNormal, , , ,
acDialog

If gintAttorneyID <> -1 Then
If DCount("*", "lnktblATTORNEYWMA", "WMANo='" &
Me.txtWMANo & "'") > 0 Then
strSQL = "UPDATE lnktblATTORNEYWMA Set
AttorneyID = " & _
gintAttorneyID & " WHERE WMANo = '" &
Me.txtWMANo & "';"
Else
strSQL = "INSERT INTO lnktblATTORNEYWMA
(AttorneyID,WMANo) Values(" & _
gintAttorneyID & ",'" &
Me.txtWMANo & "');"
End If

DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True
End If

Me.Text276.Requery
End Sub
 
Sorry, I was just gathering more information. I have an
Attorney, Managing Attorney, Client, and Master tables
that have one-to-many relationships.

The message that I am getting is "You cannot add or change
a record because a related record is required in table
Attorney."
 
Back
Top