Hello All,
The code below worked when wjem the DrawingID was a text, i switched it to a number now my database went to S**T. I am an engineer and new to coding and need to get this out the door today, or its my ass. Anyone have any suggestions? I have allready tried Dim MaxComponentID As long and Dim MaxComponentID As variant. Any other sugestions? I am not sure if this maters the format for drawing ID is 00 Long Interger. Code below
Private Sub Command14_Click()
Dim AssyIDvalue As String
AssyIDvalue = Me.AssemblyID.Value
Dim MaxComponentID As String
MaxComponentID = DMax("DrawingID", "Assemblylog", "[AssemblyID]='" & AssyIDvalue & "'") + 1
Forms!frmAddComponent!DrawingId.Value = MaxComponentID
DoCmd.GoToRecord , , acNewRec
stDocName = "frmSubAssemblylog"
DoCmd.Close acForm, "frmAddComponent"
Forms!frmstorage!Text0.Value = AssyIDvalue
DoCmd.OpenForm stDocName ', , , stLinkCriteria
End Sub