T
Tal
Hello,
I am making a donation database where many of the donors have multiple
addresses. I am creating the Edit Donor form and have filtered it using the
following code (This is my first foray, so it might not be pretty)
The cboAddressLabel field identifies the specific address. Within this
address I have a lookup field that calls a province/state table that contains
a list of Provinces and States. However, when I select this combo box in my
form it only contains those provinces that have been previously selected
(meaning, it is limited to the contents of the query) more specifically - I
have Ontario listed four times. I have set the record source of the field to
the province state table, but nothing seems to be working. Help!!!!
Private Sub cboSearchDonor_AfterUpdate()
Dim strWhere As String
Const strcStub = "SELECT * FROM qryDonorsandAddresses "
If Not IsNull(Me.cboSearchDonor) Then
strWhere = "WHERE (keyDonor = " & Me.cboSearchDonor & ")"
End If
Forms![frmAddorEditDonors].RecordSource = strcStub & strWhere
End Sub
Private Sub cboSearchDonor_LostFocus()
Dim SAddressLabel As String
SAddressLabel = "SELECT [qryDonorsandAddresses].[keyDonorAddress],
[qryDonorsandAddresses].[txtAddressLabel] " & _
"FROM qryDonorsandAddresses " & _
"WHERE [qryDonorsandAddresses].[keyDonor] = " &
Me.cboSearchDonor.Value
Me.cboAddressLabel.RowSource = SAddressLabel
Me.cboAddressLabel.Requery
Me!cboSearchDonor.Value = ""
End Sub
Private Sub cboAddressLabel_AfterUpdate()
Dim strWhere As String
Const strcStub = "SELECT * FROM qryDonorsandAddresses "
Const strcTail = "SELECT * FROM tblProvinceState "
If Not IsNull(Me.cboAddressLabel) Then
strWhere = "WHERE (keyDonorAddress = " & Me.cboAddressLabel & ")"
End If
Forms![frmAddorEditDonors].RecordSource = strcStub & strWhere & strcTail
End Sub
I am making a donation database where many of the donors have multiple
addresses. I am creating the Edit Donor form and have filtered it using the
following code (This is my first foray, so it might not be pretty)
The cboAddressLabel field identifies the specific address. Within this
address I have a lookup field that calls a province/state table that contains
a list of Provinces and States. However, when I select this combo box in my
form it only contains those provinces that have been previously selected
(meaning, it is limited to the contents of the query) more specifically - I
have Ontario listed four times. I have set the record source of the field to
the province state table, but nothing seems to be working. Help!!!!
Private Sub cboSearchDonor_AfterUpdate()
Dim strWhere As String
Const strcStub = "SELECT * FROM qryDonorsandAddresses "
If Not IsNull(Me.cboSearchDonor) Then
strWhere = "WHERE (keyDonor = " & Me.cboSearchDonor & ")"
End If
Forms![frmAddorEditDonors].RecordSource = strcStub & strWhere
End Sub
Private Sub cboSearchDonor_LostFocus()
Dim SAddressLabel As String
SAddressLabel = "SELECT [qryDonorsandAddresses].[keyDonorAddress],
[qryDonorsandAddresses].[txtAddressLabel] " & _
"FROM qryDonorsandAddresses " & _
"WHERE [qryDonorsandAddresses].[keyDonor] = " &
Me.cboSearchDonor.Value
Me.cboAddressLabel.RowSource = SAddressLabel
Me.cboAddressLabel.Requery
Me!cboSearchDonor.Value = ""
End Sub
Private Sub cboAddressLabel_AfterUpdate()
Dim strWhere As String
Const strcStub = "SELECT * FROM qryDonorsandAddresses "
Const strcTail = "SELECT * FROM tblProvinceState "
If Not IsNull(Me.cboAddressLabel) Then
strWhere = "WHERE (keyDonorAddress = " & Me.cboAddressLabel & ")"
End If
Forms![frmAddorEditDonors].RecordSource = strcStub & strWhere & strcTail
End Sub