smtazulislam
Member
- Local time
- Today, 15:41
- Joined
- Mar 27, 2020
- Messages
- 806
Why I can't see "PREVIEW content page". Its always error.
It is the same for me.Why I can't see "PREVIEW content page". Its always error.
Unless you follow the instructions and post the string created by the code we're just guessing.Thank you so much for your instructions
I am sorry because I am very much a beginner here but as I wrote earlier today, I followed your instructions and there was NO string to post here. It only said the word True.Unless you follow the instructions and post the string created by the code we're just guessing.
There would always be a value. Please make sure you have stopped the code on the correct line. The code actually needs to run up to that point in order for Access to build the string. This is a basic part of debugging so it is worthwhile trying to do this so you understand how it works.I followed your instructions and there was NO string to post here. It only said the word True.
I absolutely want to learn this and get this right, you are so right. I have tried putting the stop on every line in the code just to test it out and literally nothing comes up when I run it. Tell me if I am totally doing this wrong.There would always be a value. Please make sure you have stopped the code on the correct line. The code actually needs to run up to that point in order for Access to build the string. This is a basic part of debugging so it is worthwhile trying to do this so you understand how it works.
The stop doesn't do anything except stop the code. You have to open the form and do whatever you do to run the code. When it gets to the line with the stop, the code stops and the vba window opens. YOU have to not put a command in the immediate window to print out the string.
? sWhere followed by enter. Then copy what gets printed
Public Function GetFilter() As String
'need variable for each partial filter
Dim strName As String
Dim strDate As String
Dim strState As String
Dim strCountry As String
Dim strID As String
Dim strBetween As String
'Need final filter
Dim StrFilter As String
Dim AndOr As CombineFilterType
'Optional Code for 'and or'. If not remove code for this.
Select Case Me.frmAndOr
Case 1
AndOr = ct_And
Case 2
AndOr = ct_OR
End Select
strName = GetFilterFromControl(Me.cmboName)
strState = GetFilterFromControl(Me.listState)
strCountry = GetFilterFromControl(Me.cmboCountry)
strDate = GetFilterFromControl(Me.cmboCreated)
strID = GetFilterFromTextBox(Me.txtID, sdt_Numeric, "ID", flt_Equal)
If IsDate(Me.cmboDateEnd) And IsDate(Me.cmboDateStart) Then
strBetween = GetBetweenFilter(Me.cmboDateStart, Me.cmboDateEnd, "Created_Date")
End If
StrFilter = CombineFilters(AndOr, strName, strState, strCountry, strDate, strID, strBetween)
GetFilter = StrFilter
'need code for each combo. Just copy and past. Need to handle dates and strings
End Function