Garcimat
Member
- Local time
- Tomorrow, 04:08
- Joined
- Jun 7, 2022
- Messages
- 67
Hi guys I can’t get it to work, my form opens with a random record.
double click in a list box > get values from columns with global variables (variants)> open form with the record based on the variants…. Coding below
Private Sub lst_ActivePermits_DblClick(Cancel As Integer)
'On Error GoTo ErrorBin_Err
gvar_SWONumber = lst_ActivePermits.Column(0) 'capture value 1 from list box (SWO Number)
gvar_PtfNumber = lst_ActivePermits.Column(1) 'capture value 2 from list box (SWO Date)
DoCmd.Close
DoCmd.OpenForm "frm_PTF2", acNormal, "txt_SWO_Number ='" & gvar_SWONumber And "txt_PTF_Number ='" & gvar_PtfNumber, acFormEdit
'ErrorBin_Exit:
' Exit Sub
'ErrorBin_Err:
' MsgBox Err.Number & " " & Err.Description
' Resume ErrorBin_Exit
End Sub
double click in a list box > get values from columns with global variables (variants)> open form with the record based on the variants…. Coding below
Private Sub lst_ActivePermits_DblClick(Cancel As Integer)
'On Error GoTo ErrorBin_Err
gvar_SWONumber = lst_ActivePermits.Column(0) 'capture value 1 from list box (SWO Number)
gvar_PtfNumber = lst_ActivePermits.Column(1) 'capture value 2 from list box (SWO Date)
DoCmd.Close
DoCmd.OpenForm "frm_PTF2", acNormal, "txt_SWO_Number ='" & gvar_SWONumber And "txt_PTF_Number ='" & gvar_PtfNumber, acFormEdit
'ErrorBin_Exit:
' Exit Sub
'ErrorBin_Err:
' MsgBox Err.Number & " " & Err.Description
' Resume ErrorBin_Exit
End Sub