Add New Record Issue

I have a form “frm_NewDevice” that has a data source of “tbl_Inventory”.

When I enter all the information and press the save button, which includes the following code:

Private Sub btn_Save_Click()

If Me.Dirty Then

If Status.Value = 3 Then

Select Case cbo_DeviceType.Value

Case 1

GoTo Message

Case 4

GoTo Message

Case 5

GoTo Message

Case 9

GoTo Message

Case 15

GoTo Message

Case 19

GoTo Message

Case 20

GoTo Message

Case Else

GoTo Proceed

End Select

Else

GoTo Proceed

End If

End If

Message:

If AssetTag = Null Then

MsgBox "This device type requires an Asset Tag. Please add one to continue.", vbOKOnly, "Missing Asset Tag"

GoTo Leave

Else

Me.Dirty = False

GoTo Proceed

End If

Leave:

Exit Sub

Proceed:

If Me.NewRecord Then

Call AuditChanges("DeviceID", "New")

Else

Call AuditChanges("DeviceID", "Edit")

End If

DoCmd.OpenForm "frm_Home"

DoCmd.Close acForm, "frm_NewDevice"

End Sub

However, the code runs without issue. No errors, etc. The tbl_AuditTrail gets a new record added as it sees there is a new record in play. The tbl_Inventory is never updated to reflect the new record being added. What an I missing that this is now not working?

submitted by /u/VooDeux48
[link] [comments]

Posted on

Add New Record Issue

I have a form “frm_NewDevice” that has a data source of “tbl_Inventory”.

When I enter all the information and press the save button, which includes the following code:

Private Sub btn_Save_Click()

If Me.Dirty Then

If Status.Value = 3 Then

Select Case cbo_DeviceType.Value

Case 1

GoTo Message

Case 4

GoTo Message

Case 5

GoTo Message

Case 9

GoTo Message

Case 15

GoTo Message

Case 19

GoTo Message

Case 20

GoTo Message

Case Else

GoTo Proceed

End Select

Else

GoTo Proceed

End If

End If

Message:

If AssetTag = Null Then

MsgBox "This device type requires an Asset Tag. Please add one to continue.", vbOKOnly, "Missing Asset Tag"

GoTo Leave

Else

Me.Dirty = False

GoTo Proceed

End If

Leave:

Exit Sub

Proceed:

If Me.NewRecord Then

Call AuditChanges("DeviceID", "New")

Else

Call AuditChanges("DeviceID", "Edit")

End If

DoCmd.OpenForm "frm_Home"

DoCmd.Close acForm, "frm_NewDevice"

End Sub

However, the code runs without issue. No errors, etc. The tbl_AuditTrail gets a new record added as it sees there is a new record in play. The tbl_Inventory is never updated to reflect the new record being added. What an I missing that this is now not working?

submitted by /u/VooDeux48
[link] [comments]

Posted on