A
Angi
I might as well move in here!
The code pretty much says it all, but if there aren't any records to
DCount, then I get the "else". How do I say "If the recordset is
empty"? I tried If reccount... Or Recordset Is Empty and it says Object
required. Changed it to Me.Recordset, says object required again.
Private Sub cmdAddShipTo_Click()
Dim stDocName As String
Dim stLinkCriteria As String
Dim RecCount As Integer
RecCount = DCount("[CoID]", "[ShipToMain]", "[shiptomain.CoID] =
[coid]")
If RecCount < 3 Then
stDocName = "ShipToMainForm"
DoCmd.OpenForm stDocName, , , , acFormAdd, , Me.CoID
Else
MsgBox ("There are already 3 ship to addresses for this
company!")
End If
End Sub
The code pretty much says it all, but if there aren't any records to
DCount, then I get the "else". How do I say "If the recordset is
empty"? I tried If reccount... Or Recordset Is Empty and it says Object
required. Changed it to Me.Recordset, says object required again.
Private Sub cmdAddShipTo_Click()
Dim stDocName As String
Dim stLinkCriteria As String
Dim RecCount As Integer
RecCount = DCount("[CoID]", "[ShipToMain]", "[shiptomain.CoID] =
[coid]")
If RecCount < 3 Then
stDocName = "ShipToMainForm"
DoCmd.OpenForm stDocName, , , , acFormAdd, , Me.CoID
Else
MsgBox ("There are already 3 ship to addresses for this
company!")
End If
End Sub