Results 1 to 9 of 9
  1. #1
    Killerbee is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    5

    multi-user question

    Hi all, first time caller, long time listener.



    This is the last piece I need to make my project go away finally, and it's stumped a few people.

    I have a form linked to a query that will populate fields to indicate
    1) how many accounts belong to the user that are passed due
    2) how many accounts belong to the user that are not passed due
    3) how many new accounts there are
    4) a drop down by province of the account.

    1, 2 and 4 work well.
    My problem is this.

    Say John and Mary have the same criteria for new policies,
    John goes into the account selection screen and it says there are 100 policies to view.
    Mary goes into the same screen and because they have the same criteria, she also sees she can work on 100 accounts.

    John selects the first one. The form opens the new screen and sets the value of the 'ownership' to John.
    This was planned for John to 'claim' the account.
    However, when Mary enters the new account, her first one is the one John is working on and there are conflicts after that

    I've tried different things like Updating the ownership using a query, setting the value inside the form.
    My coworker also suggested this simple check

    If Me.Dirty Then
    DoCmd.RunCommand acCmdSaveRecord
    End If

    Please help me get this off of my plate

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Well, the code you posted will simply save the record. If prior to that you marked the record as John's, then that combined with a criteria in Mary's process that excludes owned records should do it. If Mary has already opened a form displaying the records, that form would need to be requeried to see that John has taken ownership of the first record.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Killerbee is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    5
    Yeah, I agree that it should, it just doesn't.

    When one clicks the "go" button, it runs this code.



    DoCmd.SetWarnings False


    Dim stDocName As String
    Dim stLinkCriteria As String
    Dim stlinkfilter As String


    stLinkCriteria = "[U/W] IS NULL and COMPLETED = No"
    stlinkfilter = "Ceded: New Policies" '<--- this is a basic query that looks for accounts that don't have an owner as well as some qualifying criteria

    stDocName = "Ceding"
    'ceding is the name of the table the data is stored (as well as the form)
    DoCmd.OpenForm stDocName, , stlinkfilter, stLinkCriteria
    Me.Requery

    DoCmd.OpenQuery "TimeStamp: Ceding Start"
    DoCmd.RunMacro "SetName"
    'DoCmd.OpenQuery "UpdateName"
    'Me.Refresh

    Forms("Ceding").Form.Controls("QueryType").Value = 3
    'Me.Dirty = False
    If Me.Dirty Then
    DoCmd.RunCommand acCmdSaveRecord
    End If
    DoCmd.Close acForm, "Ceding Selection"

    So, from my perspective, it generates the new query when one hits the go button and at that time, if somone has entered another account and had the ownership updated, it should recognize that..

    Just checking it now (running the query in the back ground).
    Once I enter the record, a query does NOT have the ownership populated, but if I put the form into design mode, the query gets updated..

    arrgggg (as spoken by Charlie Brown)

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    The macro sets a value on the form? Can you post the db?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Killerbee is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    5
    sure

    Sets the combo box that the username is connected to (combo43)
    [Forms]![Ceding]![Combo43]
    to
    UserIDs(GetUserName())

    GetUserName() is just the typical windows query and the UserIDs is a function that returns a ' name'

    It has a condition that only updates it if the combo43 is NULL

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    It appears that you're setting a value on the form named "Ceding" but doing your save on the form this code is in. That means the value in Ceding hasn't been saved, and thus queries would not see that changed value.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    Killerbee is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    5
    Any recommendations on how I can save this value to this field in the table right away?

  8. #8
    Killerbee is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    5
    Found my answer, in the original code to say
    If me.dirty then


    and changed that to
    if me.dirty = false then


    and it worked.

    Thanks for your help though

    Brett

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Really? That's basically saying to save the data if it hasn't been changed. In any case, glad it's working for you.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Design multi user database - avoid simultaneity transactions
    By snoopy2003 in forum Database Design
    Replies: 2
    Last Post: 02-27-2011, 12:03 AM
  2. Replies: 5
    Last Post: 12-19-2010, 04:40 PM
  3. New user with question
    By gabety in forum Access
    Replies: 9
    Last Post: 12-15-2010, 02:23 PM
  4. New user question
    By ppiper in forum Forms
    Replies: 1
    Last Post: 12-01-2010, 12:11 PM
  5. Replies: 13
    Last Post: 05-18-2010, 01:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums