Re: The Instr Function Again???
Dear friends & (Arthur Wood),
I tried to do the following code mentioned from my first question. I think
I am doing something wrong here.
thanks in advance for all you great help!
Junior VB Developer
My code is below, please see:
I have (SQL = SQL &) because I have another SQL Statement that performs work
for date To and From through my DTPickers. I am just concatenating the SQL
If cboStudyID.Text <> "<All Studies>" Then
Dim strStudyIDText As String
Dim lStudyID As Long
Dim iPosition As Integer
strStudyIDText = cboStudyID.Text
iPosition = InStr(" ", strStudyIDText)
If iPosition > 0 Then
lStudyID = CLng(Left$(strStudyIDText, iPosition - 1))
'In SQL, compare cboStudyID with 3 fields (AuditTrailTableKey,
'AuditTrailFrom and AuditTrailTo) found within Audit Trail Table.
SQL = SQL & " and (AuditTrailTableKey = '" & lStudyID & "')" & _
" Or (AuditTrailFrom = '" & lStudyID & "') Or (AuditTrailTo =
'" & lStudyID & "')"
'SQL = SQL & " and (AuditTrailTableKey = '" & cboStudyID.Text
& "')" & _
'" Or (AuditTrailFrom = '" & cboStudyID.Text & "') Or (AuditTrailTo
= '" & cboStudyID.Text & "')"
'Display on the report, the StudyID that the user chose
m_Report.SubTitle.SetText " Audit Trail - StudyID: " & cboStudyID.Text
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center