D
Deleted member 8621
Guest
I'm using vba in one form and if they decide to save the record I check to see if the "upgrade" check box is checked. If it is I'm trying to open another form that makes them select the software that makes the upgrade legit. I will then save that value, return to the original form and save the new record with the value from the second form.
I can't seem to open the second form and wait for input. vba just runs straight through my code without waiting for input on the second form.
Help
thanks
matthew my code is below
Private Sub btnAssign_Click()
On Error GoTo Err_btnAssign_Click
Dim rst As DAO.Recordset
Dim strsql As String
Dim hdw As String
Dim oem As String
Dim viol As String
Dim compoem As String
viol = "Computer: " & GetWinComputerName() & " User: " & GetWinUserName & " " & Now()
hdw = Forms!frmAssignLicenses!HdwSn
oem = Forms!frmAssignLicenses!OemSn
Upgd_Check:
If Me!Upgrade = True Then
DoCmd.OpenForm "frmAssignUpgdLic"
Forms!frmAssignUpgdLic!sftw = "is this working"
End If
Assign_Lic:
If Forms!frmAssignLicenses.opgSelectSftwCat = 2 Then
strsql = "SELECT TOP 1 Company, Software, Version," & _
" Upgrade, LicenseNum, PartNum," & _
" NumLicenses, OperatingSys, OemSn," & _
" SnSrvtag, UpgComplianceOem, Note," & _
" [Site Licensed], LicViolation" & _
" FROM tblLicenses" & _
" WHERE (((OemSn)='" & oem & "') AND ((SnSrvtag)='2'));"
Set rst = CurrentDb.OpenRecordset(strsql)
rst.Edit
rst!SnSrvtag = hdw
rst.Update
Else: Me!SftwHdwSn = Me!HdwSn
Me!Installed = True
End If
DoCmd.Close
Exit_btnAssign_Click:
Exit Sub
Err_btnAssign_Click:
MsgBox Err.Description
Resume Exit_btnAssign_Click
I can't seem to open the second form and wait for input. vba just runs straight through my code without waiting for input on the second form.
Help
thanks
matthew my code is below
Private Sub btnAssign_Click()
On Error GoTo Err_btnAssign_Click
Dim rst As DAO.Recordset
Dim strsql As String
Dim hdw As String
Dim oem As String
Dim viol As String
Dim compoem As String
viol = "Computer: " & GetWinComputerName() & " User: " & GetWinUserName & " " & Now()
hdw = Forms!frmAssignLicenses!HdwSn
oem = Forms!frmAssignLicenses!OemSn
Upgd_Check:
If Me!Upgrade = True Then
DoCmd.OpenForm "frmAssignUpgdLic"
Forms!frmAssignUpgdLic!sftw = "is this working"
End If
Assign_Lic:
If Forms!frmAssignLicenses.opgSelectSftwCat = 2 Then
strsql = "SELECT TOP 1 Company, Software, Version," & _
" Upgrade, LicenseNum, PartNum," & _
" NumLicenses, OperatingSys, OemSn," & _
" SnSrvtag, UpgComplianceOem, Note," & _
" [Site Licensed], LicViolation" & _
" FROM tblLicenses" & _
" WHERE (((OemSn)='" & oem & "') AND ((SnSrvtag)='2'));"
Set rst = CurrentDb.OpenRecordset(strsql)
rst.Edit
rst!SnSrvtag = hdw
rst.Update
Else: Me!SftwHdwSn = Me!HdwSn
Me!Installed = True
End If
DoCmd.Close
Exit_btnAssign_Click:
Exit Sub
Err_btnAssign_Click:
MsgBox Err.Description
Resume Exit_btnAssign_Click