L
LeslieJ via AccessMonster.com
I have a continuous form that acts as a search form for my database. I have
seven search criteria controls that could be used to filter the form. I use
a command button to filter the form, and take the filter off. The form is
based on a query that I made from several different tables in order to get
all the information I need.
Two of the controls are giving me troubles with the VBA. I have declared
strWhere as a string.
The first one, I have two combo boxes called cboFilterStatus1, and
cboFilterStatus2 so that the users can choose to filter the form using two
status types.
The code I have for it is this:
If Not IsNull(Me.cboFilterStatus1) And Not IsNull(Me.cboFilterStatus2) Then
strWhere = strWhere & "[Document Version Information].[Document Status Type]
= " & Me.cboFilterStatus1 & " OR [Document Version Information].
[Document Status Type] = " & Me.cboFilterStatus2
End If
It gives me a Run Time Error 2448 ‘You can’t assign a value to this objectâ€
I have checked with a message box that it's trying to send the right values
to the filter.
The second problem is two text boxes called txtEffStartDate and txtEffEndDate.
I want the users to be able to type in two dates, and only records that fall
between the date range will be shown once filtered.
The code I have for this is:
If Not IsNull(Me.txtEffStartDate) And Not IsNull(Me.txtEffEndDate) Then
strWhere = strWhere & "[Document Version Information].[Effective Date] >= " &
Me.txtEffStartDate & " And [Document Version Information].[Effective Date] <=
" & Me.txtEffEndDate
End If
It also gives me a Run Time Error 2448.
I have double checked that all my table names are correct, and spelling is
correct, and no mistakes in typing.
I know that I’ve just been looking at this for too long, and that is why I am
not seeing what the error is.
This site has been a mind-saver, I thank you for all your help!
seven search criteria controls that could be used to filter the form. I use
a command button to filter the form, and take the filter off. The form is
based on a query that I made from several different tables in order to get
all the information I need.
Two of the controls are giving me troubles with the VBA. I have declared
strWhere as a string.
The first one, I have two combo boxes called cboFilterStatus1, and
cboFilterStatus2 so that the users can choose to filter the form using two
status types.
The code I have for it is this:
If Not IsNull(Me.cboFilterStatus1) And Not IsNull(Me.cboFilterStatus2) Then
strWhere = strWhere & "[Document Version Information].[Document Status Type]
= " & Me.cboFilterStatus1 & " OR [Document Version Information].
[Document Status Type] = " & Me.cboFilterStatus2
End If
It gives me a Run Time Error 2448 ‘You can’t assign a value to this objectâ€
I have checked with a message box that it's trying to send the right values
to the filter.
The second problem is two text boxes called txtEffStartDate and txtEffEndDate.
I want the users to be able to type in two dates, and only records that fall
between the date range will be shown once filtered.
The code I have for this is:
If Not IsNull(Me.txtEffStartDate) And Not IsNull(Me.txtEffEndDate) Then
strWhere = strWhere & "[Document Version Information].[Effective Date] >= " &
Me.txtEffStartDate & " And [Document Version Information].[Effective Date] <=
" & Me.txtEffEndDate
End If
It also gives me a Run Time Error 2448.
I have double checked that all my table names are correct, and spelling is
correct, and no mistakes in typing.
I know that I’ve just been looking at this for too long, and that is why I am
not seeing what the error is.
This site has been a mind-saver, I thank you for all your help!