mkcat
May 18 2012, 01:49 PM
Hi,
I am using Listitem to set my list of data.
User selects detail by double clicking on data line.
User updates detail data.
Exits back to list of data.
The process I have always sets the list back to the first item even though
the user is actually on a data record that they had to scroll down to get.
I can't seem to find a way to position the listitem box so the user's selected item
is in the 'current' view, I don't care where it is in the current view, just so long
as it is somewhere in the current view.
When the user goes to the detail, I recreate the listitem so any changes are incorporated.
Any guidance on this would be appreciated.
thanks
theDBguy
May 18 2012, 01:57 PM
Hi,
What version of Access are you using? Please remember to select the version number when posting questions in case it becomes relevant to the discussion.
Not sure I understand your setup. Are you referring to a form in Datasheet View or Continous Form View and using a Popup form to make the changes? If so, then you should be able to use the Bookmark property to go back to the selected record.
Just my 2 cents...
mkcat
May 18 2012, 02:08 PM
Access 2003 (development) for 2007 use.
Using ListviewCtl object
Microsoft Common Controls 6.0 (MSComctl.ocx)
I select the detail by:
DoCmd.OpenForm "frmDataEntryA", , , "[tblccards.ssn]=" & "'" & lvxObj.SelectedItem & "'", , acDialog
When I come back from frmDataEntryA
I reload data and set colors as so:
lstItem.SubItems(i) = Nz(Trim(rst(i)), "")
If i = 1 Then
Combo24.AddItem (Nz(Trim(rst(i)), ""))
End If
If Not IsNull(rst1![inactive date]) Then
lstItem.ListSubItems.Item(i).ForeColor = vbgrnBl 'vbGreen
ElseIf ViewList = 3 Then 'add
lstItem.ListSubItems.Item(i).ForeColor = vbBlack
ElseIf rst("cdexpiredate") < Now() Then
lstItem.ListSubItems.Item(i).ForeColor = vbRed
ElseIf ViewList = 2 Then
lstItem.ListSubItems.Item(i).ForeColor = vbRed
ElseIf rst("cdexpiredate") < dnewdate Then
lstItem.ListSubItems.Item(i).ForeColor = vbBlue
Else
lstItem.ListSubItems.Item(i).ForeColor = vbBlack
End If
but this always positions me at the top of the list.
Hope this makes sense.
theDBguy
May 21 2012, 10:11 AM
Hi,
Not sure what to recommend, I have not used ListViews before. Are you able to post a zip copy of your db with test data?
Just my 2 cents...
mkcat
May 22 2012, 01:23 PM
I realized (duh?) I could use my search function to save and set the place to return to.
Just had to save in the correct spot.
Works fine.
But now the whole load is exceedingly slow. Working on that.
May end up changing to flexgrid. Will muddle through.
Thanks for assistance.
theDBguy
May 22 2012, 06:04 PM
Hi,

Glad to hear you're making good progress.
Continued success with your project.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.