View Single Post
  #10  
Old January 15th, 2010, 03:08 PM posted to microsoft.public.access.formscoding,microsoft.public.access.multiuser,microsoft.public.access.queries,microsoft.public.access
Jack Leach
external usenet poster
 
Posts: 33
Default trying to minimize Write Conflicts in a multi-user database

For a combo...

The .ListIndex property (0 based) tells what item you have selected (or -1
for no selection). Use this and the .Column(.ListIndex) to get the the
currently selected record.

The .ListCount (1 based) tells how many list items there are in the source
of the combo. Use this to determine if the current selection is the last
one. If .ListIndex = .ListCount - 1 Then LastRecord = True

You should be able to "select" a record using the Column property:

Me.Combo = Me.Combo.Column(Me.Combo.ListIndex + 1)


This should give you an idea where to start.

I haven't tried yet, but am still a bit curious about how to handle a
recordsource of the main form for a new record... I *think* that, per Tom's
suggestion, you can set the SQL to WHERE 1 = 0 (which will display no
records), and be able to enter a new record this way. I think that's the
case, but haven't tested yet.

This really is a great idea, I will also begin to do some redesigning
(haven't had an issue with write conflicts as of yet, but that's not to say I
won't...) And many thanks to Tom for making the points on Memo, OLE and MVF
fields... I was not aware of this either.

--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)



"John Spencer" wrote:

As for question 3

3. Since the main form has only one record loaded at any time, the normal
navigation buttons won't be able to do anything. Are there any Web sites
that address building custom navigation buttons for single-record forms?

You can build code to move next or move previous based on the combobox you are
using to get the record. You just need to know which record you are on and
where that is in the combobox. Then get the value of the previous/next row in
the combobox, set the combobox to that row and execute the code to select the
record based on that value.

If you need help building that code, post back. If I have some free time
later today, I will try to help.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
.