View Single Post
  #20  
Old January 17th, 2010, 08:44 AM posted to microsoft.public.access.formscoding,microsoft.public.access.multiuser,microsoft.public.access.queries,microsoft.public.access
Tom Wickerath
external usenet poster
 
Posts: 3,914
Default trying to minimize Write Conflicts in a multi-user database

Hi Paul,

Thanks for the nice compliment on my Multiuser Applications paper!

However, they, along with my combo box, are also empty. Is there a way I
could get both the combo box and the form to display the first record in the
recordset when the form first opens?


Sure, you just need to uniquely identify the record in question, and use the
appropriate WHERE clause. So, instead of using WHERE 1=0, use something like:

WHERE [PrimaryKeyFieldName] = NumericValue (for a numeric PK field)
or
WHERE [PrimaryKeyFieldName] = 'TextValue' (for a text-based PK field)

Notes:
Use the quotes surrounding the TextValue for a text-based value.
You can specify a different field as well, as long as the field has a unique
index, in order to retrieve just one record.


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
__________________________________________

"Paul" wrote:

Tom,

It was your excellent article at

http://www.accessmvp.com/TWickerath/.../multiuser.htm

that launched me on this path in the first place. I've got two tables with
a memo field, and I plan to isolate them into separate 1 to 1 tables in the
coming weeks. I already took a run at it and quickly realized that I'll be
spending several weeks debugging all the changes required by the new table
structure. I thought that in the meantime, I'd take the step of loading one
record at a time into the main form, instead of multiple records.

I found your suggestion to set the RecordSource in the form's Load event to

SELECT * FROM table WHERE 1=0


to be very helpful, because now when the form loads all of the controls and
subforms are visible.

However, they, along with my combo box, are also empty. Is there a way I
could get both the combo box and the form to display the first record in the
recordset when the form first opens?

(If it requires DAO or ADO code, a dumbded-down answer in the form of the
actual code would be most welcome).

Thanks

Paul