Data Lock on Form

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andy

    Data Lock on Form

    newbie question here---
    In Table1 I have basic membership information. Table 2 is 'event'
    information. I have a form for Table2 with a combo box, where the user
    will pick a member from Table1, and then fill in the rest of the data.

    My question is this - I fear the combo box will be used incorrectly -
    that is, they will use it to 'find' a record. Click on the drop down
    box and make a selection. However doing that of course does not find a
    record, it changes the current record. I was thinking I need some kind
    of lock on that field that is in place after the user clicks a button
    or something. If the record needs to be changed, they would have to go
    eslewhere to ensure they know they are changing the record.

    I'm sure many people have run into this before. If you could tell me
    what you do to solve it, it would appreciate it. p.s. I do not know
    VBA, if the only solution is in VBA you will need to walk me through
    it step by step.Thank you.
  • Allen Browne

    #2
    Re: Data Lock on Form

    Use the AfterUpdate event of the combo to ask the user if they really meant
    to reassign the value:

    Private Sub cbo_AfterUpdate ()
    Dim strMsg As String
    With Me.cbo
    If .Value <> .OldValue Then
    strMsg = "Reassignin g this record from " & .OldValue & _
    " to " & .Value & "." & vbCrLf & "Continue?"
    If MsgBox(strMsg, vbYesNo+vbDefau ltButton2) = vbNo Then
    .Undo
    End If
    End If
    End With
    End Sub

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    "Andy" <andykeil1@acce sstoledo.com> wrote in message
    news:23c8d724.0 409240439.2d742 fe2@posting.goo gle.com...[color=blue]
    > newbie question here---
    > In Table1 I have basic membership information. Table 2 is 'event'
    > information. I have a form for Table2 with a combo box, where the user
    > will pick a member from Table1, and then fill in the rest of the data.
    >
    > My question is this - I fear the combo box will be used incorrectly -
    > that is, they will use it to 'find' a record. Click on the drop down
    > box and make a selection. However doing that of course does not find a
    > record, it changes the current record. I was thinking I need some kind
    > of lock on that field that is in place after the user clicks a button
    > or something. If the record needs to be changed, they would have to go
    > eslewhere to ensure they know they are changing the record.
    >
    > I'm sure many people have run into this before. If you could tell me
    > what you do to solve it, it would appreciate it. p.s. I do not know
    > VBA, if the only solution is in VBA you will need to walk me through
    > it step by step.Thank you.[/color]


    Comment

    • Alan Webb

      #3
      Re: Data Lock on Form

      Andy,
      Don't bind the combo box to a field in the underlying query. That should
      take care of it.

      "Andy" <andykeil1@acce sstoledo.com> wrote in message
      news:23c8d724.0 409240439.2d742 fe2@posting.goo gle.com...[color=blue]
      > newbie question here---
      > In Table1 I have basic membership information. Table 2 is 'event'
      > information. I have a form for Table2 with a combo box, where the user
      > will pick a member from Table1, and then fill in the rest of the data.
      >
      > My question is this - I fear the combo box will be used incorrectly -
      > that is, they will use it to 'find' a record. Click on the drop down
      > box and make a selection. However doing that of course does not find a
      > record, it changes the current record. I was thinking I need some kind
      > of lock on that field that is in place after the user clicks a button
      > or something. If the record needs to be changed, they would have to go
      > eslewhere to ensure they know they are changing the record.
      >
      > I'm sure many people have run into this before. If you could tell me
      > what you do to solve it, it would appreciate it. p.s. I do not know
      > VBA, if the only solution is in VBA you will need to walk me through
      > it step by step.Thank you.[/color]


      Comment

      Working...