ivonsurf123
Registered User.
- Local time
- Yesterday, 16:28
- Joined
- Dec 8, 2017
- Messages
- 69
Hello,
Hope you can help me to figure this out, had tried everything I know and nothing works, keep giving Nulls, It was working before, but then start giving nulls.
Hope you can help me to figure this out, had tried everything I know and nothing works, keep giving Nulls, It was working before, but then start giving nulls.
Code:
Private Sub Form_Current()
If Me.NewRecord Then
Me.lblRecordCounter.Caption = _
"Record " & Me.CurrentRecord & " of " & Me.Recordset.RecordCount + 1
Else
Me.lblRecordCounter.Caption = _
"Record " & Me.CurrentRecord & " of " & Me.Recordset.RecordCount
End If
Me.CD1_Width = Nz(DLookup("[Width]", "tbl_ClientDataFormat", "Field = '" & Me.CD1_Width.Tag & "' and CustomerSpecific_ID=" & Me.ID), "")
Me.CD1_Format = Nz(DLookup("[Format]", "tbl_ClientDataFormat", "Field = '" & Me.CD1_Format.Tag & "' and CustomerSpecific_ID=" & Me.ID), "")
End Sub
Private Sub CD1_Width_AfterUpdate()
Dim rst As Recordset
Set rst = CurrentDb.OpenRecordset("Select * from tbl_ClientDataFormat where Field= '" & Me.CD1_Width.Tag & "' and CustomerSpecific_ID=" & Me.ID, dbOpenDynaset, dbSeeChanges)
If rst.RecordCount > 0 Then
CurrentDb.Execute "INSERT INTO tbl_ClientDataFormat ([Width], [CustomerSpecific_ID], [Field]) " & _
"SELECT '" & Me.CD1_Width & "', " & Me.ID & ", '" & Me.CD1_Width.Tag & "';"
Else
rst.Edit
rst!Width = Me.CD1_Width
rst.Update
End If
rst.Close
Set rst = Nothing
End Sub
Private Sub CD1_Format_AfterUpdate()
Dim rst As Recordset
Set rst = CurrentDb.OpenRecordset("Select * from tbl_ClientDataFormat where Field= '" & Me.CD1_Format.Tag & "' and CustomerSpecific_ID=" & Me.ID, dbOpenDynaset, dbSeeChanges)
If rst.RecordCount > 0 Then
CurrentDb.Execute "INSERT INTO tbl_ClientDataFormat ([Format], [CustomerSpecific_ID], [Field]) " & _
"SELECT '" & Me.CD1_Format & "', " & Me.ID & ", '" & Me.CD1_Format.Tag & "';"
Else
rst.Edit
rst!Format = Me.CD1_Format
rst.Update
End If
rst.Close
Set rst = Nothing
End Sub