M
Marc
Dea All,
last year I fond in internet a very beautiful address book form, that I
adjusted to my needs. Last week, on request, I had to insert a new field
(Location) and now while pushing the Close button, in order to quit the
form, a little input window appears asking: Parameter Value:
Forms!frmCustomer!txtCustomerFilter
I am not able to understand where is the mistake and so I don't know where
to act.
Thanks in advance for any kind of help!
Kind regards,
Marc
The VB code is as follow:
----------------------------------------------------------------------------
Option Compare Database
Option Explicit
----------------------------------------------------------------------------
Private Sub Country_Exit(Cancel As Integer) 'Start routine First Letter
Capitol
If IsNull([Country]) = False Then
Dim x() As Byte
x = StrConv(Me!Country.Value, vbProperCase)
Me!Country.Value = x
End If
End Sub 'End routine First Letter Capitol
----------------------------------------------------------------------------
'Private Sub Customer_Exit(Cancel As Integer) 'Start routine First Letter
Capitol
'If IsNull([Customer]) = False Then
'Dim x() As Byte
' x = StrConv(Me!Customer.Value, vbProperCase)
' Me!Customer.Value = x
' End If
'End Sub 'End routine First Letter Capitol
'----------------------------------------------------------------------------------
Private Sub Fao_Exit(Cancel As Integer) 'Start routine First Letter Capitol
If IsNull([Fao]) = False Then
Dim x() As Byte
x = StrConv(Me!Fao.Value, vbProperCase)
Me!Fao.Value = x
End If
End Sub 'End routine First Letter Capitol
----------------------------------------------------------------------------
Private Sub Form_Current()
Me.lstCustomer = Me.IdCustomer
End Sub
----------------------------------------------------------------------------
Private Sub Form_Open(Cancel As Integer)
DoCmd.Maximize
End Sub
----------------------------------------------------------------------------
Private Sub grpCustomerFilter_Click()
Select Case grpCustomerFilter
Case 1
Me.txtCustomerFilter = "A"
' MsgBox "Select * FROM TblCustomer WHERE Customer Like """ &
txtCustomerFilter & "*"""
' Me.RecordSource = "Select * FROM TblCustomer WHERE Customer
Like """ & txtCustomerFilter & "*"""
' Me.Requery
Me.lstCustomer.Requery
Case 2
Me.txtCustomerFilter = "B"
Me.lstCustomer.Requery
Case 3
Me.txtCustomerFilter = "C"
Me.lstCustomer.Requery
Case 4
Me.txtCustomerFilter = "D"
Me.lstCustomer.Requery
Case 5
Me.txtCustomerFilter = "E"
Me.lstCustomer.Requery
Case 6
Me.txtCustomerFilter = "F"
Me.lstCustomer.Requery
Case 7
Me.txtCustomerFilter = "G"
Me.lstCustomer.Requery
Case 8
Me.txtCustomerFilter = "H"
Me.lstCustomer.Requery
Case 9
Me.txtCustomerFilter = "I"
Me.lstCustomer.Requery
Case 10
Me.txtCustomerFilter = "J"
Me.lstCustomer.Requery
Case 11
Me.txtCustomerFilter = "K"
Me.lstCustomer.Requery
Case 12
Me.txtCustomerFilter = "L"
Me.lstCustomer.Requery
Case 13
Me.txtCustomerFilter = "M"
Me.lstCustomer.Requery
Case 14
Me.txtCustomerFilter = "N"
Me.lstCustomer.Requery
Case 15
Me.txtCustomerFilter = "O"
Me.lstCustomer.Requery
Case 16
Me.txtCustomerFilter = "P"
Me.lstCustomer.Requery
Case 17
Me.txtCustomerFilter = "Q"
Me.lstCustomer.Requery
Case 18
Me.txtCustomerFilter = "R"
Me.lstCustomer.Requery
Case 19
Me.txtCustomerFilter = "S"
Me.lstCustomer.Requery
Case 20
Me.txtCustomerFilter = "T"
Me.lstCustomer.Requery
Case 21
Me.txtCustomerFilter = "U"
Me.lstCustomer.Requery
Case 22
Me.txtCustomerFilter = "V"
Me.lstCustomer.Requery
Case 23
Me.txtCustomerFilter = "W"
Me.lstCustomer.Requery
Case 24
Me.txtCustomerFilter = "X"
Me.lstCustomer.Requery
Case 25
Me.txtCustomerFilter = "Y"
Me.lstCustomer.Requery
Case 26
Me.txtCustomerFilter = "Z"
Me.lstCustomer.Requery
Case 27
Me.txtCustomerFilter = "*"
Me.lstCustomer.Requery
End Select
Me.RecordSource = "Select * FROM TblCustomer WHERE Customer Like
""" & txtCustomerFilter & "*"""
Me.Requery
End Sub
----------------------------------------------------------------------------
Private Sub Address1_Exit(Cancel As Integer) 'Start routine First Letter
Capitol
If IsNull([Address1]) = False Then
Dim x() As Byte
x = StrConv(Me!Address1.Value, vbProperCase)
Me!Address1.Value = x
End If
End Sub 'End routine First Letter Capitol
----------------------------------------------------------------------------
Private Sub Address2_Exit(Cancel As Integer) 'Start routine First Letter
Capitol
If IsNull([Address2]) = False Then
Dim x() As Byte
x = StrConv(Me!Address2.Value, vbProperCase)
Me!Address2.Value = x
End If
End Sub 'End routine First Letter Capitol
----------------------------------------------------------------------------
Private Sub Address3_Exit(Cancel As Integer) 'Start routine First Letter
Capitol
If IsNull([Address3]) = False Then
Dim x() As Byte
x = StrConv(Me!Address3.Value, vbProperCase)
Me!Address3.Value = x
End If
End Sub 'End routine First Letter Capitol
----------------------------------------------------------------------------
Private Sub Address4_Exit(Cancel As Integer) 'Start routine First Letter
Capitol
If IsNull([Address4]) = False Then
Dim x() As Byte
x = StrConv(Me!Address4.Value, vbProperCase)
Me!Address4.Value = x
End If
End Sub 'End routine First Letter Capitol
----------------------------------------------------------------------------
Private Sub Location_Exit(Cancel As Integer) 'Start routine First Letter
Capitol
If IsNull([Location]) = False Then
Dim x() As Byte
x = StrConv(Me!Location.Value, vbProperCase)
Me!Location.Value = x
End If
End Sub 'End routine First Letter Capitol
----------------------------------------------------------------------------
Private Sub lstCustomer_Click()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[IdCustomer] = " & Str(Me![lstCustomer])
Me.Bookmark = rs.Bookmark
Me.lstCustomer = Me.IdCustomer
End Sub
----------------------------------------------------------------------------
Private Sub cmdExplain_Click()
On Error GoTo Err_cmdExplain_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmExplanation"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdExplain_Click:
Exit Sub
Err_cmdExplain_Click:
MsgBox Err.Description
Resume Exit_cmdExplain_Click
End Sub
----------------------------------------------------------------------------
Private Sub cmdClose_Click()
On Error GoTo Err_cmdClose_Click
DoCmd.Close
Exit_cmdClose_Click:
Exit Sub
Err_cmdClose_Click:
MsgBox Err.Description
Resume Exit_cmdClose_Click
End Sub
----------------------------------------------------------------------------
Private Sub cmdNewCustomer_Click()
On Error GoTo Err_cmdNewCustomer_Click
DoCmd.GoToRecord , , acNewRec
Exit_cmdNewCustomer_Click:
Exit Sub
Err_cmdNewCustomer_Click:
MsgBox Err.Description
Resume Exit_cmdNewCustomer_Click
Me.Customer.SetFocus
End Sub
----------------------------------------------------------------------------
Private Sub cmdOpenDataEntry_Click()
Me.Refresh
On Error GoTo Err_cmdOpenDataEntry_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmDataEntry"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdOpenDataEntry_Click:
Exit Sub
Err_cmdOpenDataEntry_Click:
MsgBox Err.Description
Resume Exit_cmdOpenDataEntry_Click
End Sub
----------------------------------------------------------------------------
Private Sub cmdExitCustomer_Click()
Me.Refresh
On Error GoTo Err_cmdExitCustomer_Click
DoCmd.Close
Exit_cmdExitCustomer_Click:
Exit Sub
Err_cmdExitCustomer_Click:
MsgBox Err.Description
Resume Exit_cmdExitCustomer_Click
End Sub
last year I fond in internet a very beautiful address book form, that I
adjusted to my needs. Last week, on request, I had to insert a new field
(Location) and now while pushing the Close button, in order to quit the
form, a little input window appears asking: Parameter Value:
Forms!frmCustomer!txtCustomerFilter
I am not able to understand where is the mistake and so I don't know where
to act.
Thanks in advance for any kind of help!
Kind regards,
Marc
The VB code is as follow:
----------------------------------------------------------------------------
Option Compare Database
Option Explicit
----------------------------------------------------------------------------
Private Sub Country_Exit(Cancel As Integer) 'Start routine First Letter
Capitol
If IsNull([Country]) = False Then
Dim x() As Byte
x = StrConv(Me!Country.Value, vbProperCase)
Me!Country.Value = x
End If
End Sub 'End routine First Letter Capitol
----------------------------------------------------------------------------
'Private Sub Customer_Exit(Cancel As Integer) 'Start routine First Letter
Capitol
'If IsNull([Customer]) = False Then
'Dim x() As Byte
' x = StrConv(Me!Customer.Value, vbProperCase)
' Me!Customer.Value = x
' End If
'End Sub 'End routine First Letter Capitol
'----------------------------------------------------------------------------------
Private Sub Fao_Exit(Cancel As Integer) 'Start routine First Letter Capitol
If IsNull([Fao]) = False Then
Dim x() As Byte
x = StrConv(Me!Fao.Value, vbProperCase)
Me!Fao.Value = x
End If
End Sub 'End routine First Letter Capitol
----------------------------------------------------------------------------
Private Sub Form_Current()
Me.lstCustomer = Me.IdCustomer
End Sub
----------------------------------------------------------------------------
Private Sub Form_Open(Cancel As Integer)
DoCmd.Maximize
End Sub
----------------------------------------------------------------------------
Private Sub grpCustomerFilter_Click()
Select Case grpCustomerFilter
Case 1
Me.txtCustomerFilter = "A"
' MsgBox "Select * FROM TblCustomer WHERE Customer Like """ &
txtCustomerFilter & "*"""
' Me.RecordSource = "Select * FROM TblCustomer WHERE Customer
Like """ & txtCustomerFilter & "*"""
' Me.Requery
Me.lstCustomer.Requery
Case 2
Me.txtCustomerFilter = "B"
Me.lstCustomer.Requery
Case 3
Me.txtCustomerFilter = "C"
Me.lstCustomer.Requery
Case 4
Me.txtCustomerFilter = "D"
Me.lstCustomer.Requery
Case 5
Me.txtCustomerFilter = "E"
Me.lstCustomer.Requery
Case 6
Me.txtCustomerFilter = "F"
Me.lstCustomer.Requery
Case 7
Me.txtCustomerFilter = "G"
Me.lstCustomer.Requery
Case 8
Me.txtCustomerFilter = "H"
Me.lstCustomer.Requery
Case 9
Me.txtCustomerFilter = "I"
Me.lstCustomer.Requery
Case 10
Me.txtCustomerFilter = "J"
Me.lstCustomer.Requery
Case 11
Me.txtCustomerFilter = "K"
Me.lstCustomer.Requery
Case 12
Me.txtCustomerFilter = "L"
Me.lstCustomer.Requery
Case 13
Me.txtCustomerFilter = "M"
Me.lstCustomer.Requery
Case 14
Me.txtCustomerFilter = "N"
Me.lstCustomer.Requery
Case 15
Me.txtCustomerFilter = "O"
Me.lstCustomer.Requery
Case 16
Me.txtCustomerFilter = "P"
Me.lstCustomer.Requery
Case 17
Me.txtCustomerFilter = "Q"
Me.lstCustomer.Requery
Case 18
Me.txtCustomerFilter = "R"
Me.lstCustomer.Requery
Case 19
Me.txtCustomerFilter = "S"
Me.lstCustomer.Requery
Case 20
Me.txtCustomerFilter = "T"
Me.lstCustomer.Requery
Case 21
Me.txtCustomerFilter = "U"
Me.lstCustomer.Requery
Case 22
Me.txtCustomerFilter = "V"
Me.lstCustomer.Requery
Case 23
Me.txtCustomerFilter = "W"
Me.lstCustomer.Requery
Case 24
Me.txtCustomerFilter = "X"
Me.lstCustomer.Requery
Case 25
Me.txtCustomerFilter = "Y"
Me.lstCustomer.Requery
Case 26
Me.txtCustomerFilter = "Z"
Me.lstCustomer.Requery
Case 27
Me.txtCustomerFilter = "*"
Me.lstCustomer.Requery
End Select
Me.RecordSource = "Select * FROM TblCustomer WHERE Customer Like
""" & txtCustomerFilter & "*"""
Me.Requery
End Sub
----------------------------------------------------------------------------
Private Sub Address1_Exit(Cancel As Integer) 'Start routine First Letter
Capitol
If IsNull([Address1]) = False Then
Dim x() As Byte
x = StrConv(Me!Address1.Value, vbProperCase)
Me!Address1.Value = x
End If
End Sub 'End routine First Letter Capitol
----------------------------------------------------------------------------
Private Sub Address2_Exit(Cancel As Integer) 'Start routine First Letter
Capitol
If IsNull([Address2]) = False Then
Dim x() As Byte
x = StrConv(Me!Address2.Value, vbProperCase)
Me!Address2.Value = x
End If
End Sub 'End routine First Letter Capitol
----------------------------------------------------------------------------
Private Sub Address3_Exit(Cancel As Integer) 'Start routine First Letter
Capitol
If IsNull([Address3]) = False Then
Dim x() As Byte
x = StrConv(Me!Address3.Value, vbProperCase)
Me!Address3.Value = x
End If
End Sub 'End routine First Letter Capitol
----------------------------------------------------------------------------
Private Sub Address4_Exit(Cancel As Integer) 'Start routine First Letter
Capitol
If IsNull([Address4]) = False Then
Dim x() As Byte
x = StrConv(Me!Address4.Value, vbProperCase)
Me!Address4.Value = x
End If
End Sub 'End routine First Letter Capitol
----------------------------------------------------------------------------
Private Sub Location_Exit(Cancel As Integer) 'Start routine First Letter
Capitol
If IsNull([Location]) = False Then
Dim x() As Byte
x = StrConv(Me!Location.Value, vbProperCase)
Me!Location.Value = x
End If
End Sub 'End routine First Letter Capitol
----------------------------------------------------------------------------
Private Sub lstCustomer_Click()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[IdCustomer] = " & Str(Me![lstCustomer])
Me.Bookmark = rs.Bookmark
Me.lstCustomer = Me.IdCustomer
End Sub
----------------------------------------------------------------------------
Private Sub cmdExplain_Click()
On Error GoTo Err_cmdExplain_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmExplanation"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdExplain_Click:
Exit Sub
Err_cmdExplain_Click:
MsgBox Err.Description
Resume Exit_cmdExplain_Click
End Sub
----------------------------------------------------------------------------
Private Sub cmdClose_Click()
On Error GoTo Err_cmdClose_Click
DoCmd.Close
Exit_cmdClose_Click:
Exit Sub
Err_cmdClose_Click:
MsgBox Err.Description
Resume Exit_cmdClose_Click
End Sub
----------------------------------------------------------------------------
Private Sub cmdNewCustomer_Click()
On Error GoTo Err_cmdNewCustomer_Click
DoCmd.GoToRecord , , acNewRec
Exit_cmdNewCustomer_Click:
Exit Sub
Err_cmdNewCustomer_Click:
MsgBox Err.Description
Resume Exit_cmdNewCustomer_Click
Me.Customer.SetFocus
End Sub
----------------------------------------------------------------------------
Private Sub cmdOpenDataEntry_Click()
Me.Refresh
On Error GoTo Err_cmdOpenDataEntry_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmDataEntry"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdOpenDataEntry_Click:
Exit Sub
Err_cmdOpenDataEntry_Click:
MsgBox Err.Description
Resume Exit_cmdOpenDataEntry_Click
End Sub
----------------------------------------------------------------------------
Private Sub cmdExitCustomer_Click()
Me.Refresh
On Error GoTo Err_cmdExitCustomer_Click
DoCmd.Close
Exit_cmdExitCustomer_Click:
Exit Sub
Err_cmdExitCustomer_Click:
MsgBox Err.Description
Resume Exit_cmdExitCustomer_Click
End Sub