M
Michael Banks
Is there a way after I run a SQL string to create a sub-recordsource on
a subfrm to have the code goto a specific line in recordsource?
What I would like to do is cycle through the records in the recordsource
looking only in the row that it is currently in for a specific piece of
text?
My current attempt looks like:
Private Sub cboGLN_AfterUpdate()
Dim i As Long
Dim k As String
Dim j As String
Dim rsCount As Integer
Me!txtRecordSetCount = ""
rsCount = 0
InteriorCount = 1
Set rs = Me!subfrmPhoto.Form.RecordsetClone
Me![txtRecordSetCount] = rs.RecordCount
' k = DLookup("Location", "dbo_tblFormData", "GLN = '" & cboGLN &
"'")
' i = InStr(1, k, cboGLN)
' i = i + 12
' j = Left(k, i)
' Forms!frmphoto!subfrmPhoto.Form.RecordSource = "SELECT * from
dbo_tblFormData where [Location] like '" & j & "*'"
Do While rsCount <= txtRecordSetCount
DoCmd.GoToRecord , , acNext, 1
k = DLookup("Location", "dbo_tblFormData", "GLN = '" &
cboGLN & "'")
i = InStr(1, k, cboGLN)
i = i + 12
j = Left(k, i)
Forms!frmphoto!subfrmPhoto.Form.RecordSource = "SELECT *
from dbo_tblFormData where [Location] like '" & j & "*'"
Forms!frmphoto!subfrmPhoto.Form!ImageFrame.Picture =
Forms!frmphoto!subfrmPhoto.Form![txtLocation]
Debug.Print Forms!frmphoto!subfrmPhoto.Form![txtLocation]
InteriorCount = InteriorCount + 1
rsCount = rsCount + 1
Loop
Call DisplayPictures
End Sub
I would like to able to perform the DLookup only on the record that I am
currently in.
Thanks for your help.
Mike
a subfrm to have the code goto a specific line in recordsource?
What I would like to do is cycle through the records in the recordsource
looking only in the row that it is currently in for a specific piece of
text?
My current attempt looks like:
Private Sub cboGLN_AfterUpdate()
Dim i As Long
Dim k As String
Dim j As String
Dim rsCount As Integer
Me!txtRecordSetCount = ""
rsCount = 0
InteriorCount = 1
Set rs = Me!subfrmPhoto.Form.RecordsetClone
Me![txtRecordSetCount] = rs.RecordCount
' k = DLookup("Location", "dbo_tblFormData", "GLN = '" & cboGLN &
"'")
' i = InStr(1, k, cboGLN)
' i = i + 12
' j = Left(k, i)
' Forms!frmphoto!subfrmPhoto.Form.RecordSource = "SELECT * from
dbo_tblFormData where [Location] like '" & j & "*'"
Do While rsCount <= txtRecordSetCount
DoCmd.GoToRecord , , acNext, 1
k = DLookup("Location", "dbo_tblFormData", "GLN = '" &
cboGLN & "'")
i = InStr(1, k, cboGLN)
i = i + 12
j = Left(k, i)
Forms!frmphoto!subfrmPhoto.Form.RecordSource = "SELECT *
from dbo_tblFormData where [Location] like '" & j & "*'"
Forms!frmphoto!subfrmPhoto.Form!ImageFrame.Picture =
Forms!frmphoto!subfrmPhoto.Form![txtLocation]
Debug.Print Forms!frmphoto!subfrmPhoto.Form![txtLocation]
InteriorCount = InteriorCount + 1
rsCount = rsCount + 1
Loop
Call DisplayPictures
End Sub
I would like to able to perform the DLookup only on the record that I am
currently in.
Thanks for your help.
Mike