Results 1 to 2 of 2
  1. #1
    athyeh is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2013
    Posts
    170

    3 Forms on 1 Form

    Hi Folks,



    I have three different functions that I am trying to incorporate on the same form. Everything is working fine, but I am getting hung up on Required Values for record input. (I want different fields to be required at different times, depending on which section the user is entering from).

    Form 1 - Section 1:
    Operator creates a record in the database with many fields.

    Form 1 - Section 2:
    Operator scans in a record identifier and updates a different field (previously blank) of the record.

    Form 1 - Section 3:
    Operator scans in a record identifier and updates a different field (previously blank) of the record.

    I am trying to incorporate a rule that the operator has to select him/herself as they scan in and update each record when using sections 2 and 3.

    Is there a way to modify the code below to require a selection in Field: RecByExcOp only after ToExc updates?

    Code:
    Private Sub CheckIn_AfterUpdate()
        DoCmd.SetWarnings (False)
        Const cQuote = """"
            Me.ExcOpRec.DefaultValue = cQuote & Me.ExcOpRec.Value & cQuote
        DoCmd.OpenQuery "qryRecByExcUpd"
        Me.CheckIn = ""
        Me.ExcOpRec.SetFocus
        Me.CheckIn.SetFocus
    End Sub
    qryRecByExcUpd looks like this:

    Code:
    UPDATE tblMainDB SET tblMainDB.RecByExc = Yes, tblMainDB.RecByExc_Time = Now(), tblMainDB.RecByExcOp = [Forms]![frmExc]![ExcOpRec]
    WHERE (((tblMainDB.Note_ID)=[Forms]![frmExc]![CheckIn]));

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    Do you have a table in your database that identifies each user and what their level of access is?

    If I understand your situation your 'scanning' process is working in that you can bring up the correct record but you are stuck on how to lock/unlock specific fields

    If it is as simple:

    If the record is new alllow fields A, B, C, D, E but disable field F and G

    if field E is not populated (after the lookup), disable A, B, C, D, E, G, but enable field F

    if field E is populated but field F is not populated, disable A, B, C, D, E, F but enable field G

    then you likely don't need to keep track of users in your database but you better be sure this is actually the case before you program it this way.

    I'm assuming this is a bound form based on a query which means you're looking up specific record so you can perform the appropriate locks in the code that you're currently running to bring up the correct record after 'scanning' it.

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

Similar Threads

  1. Replies: 2
    Last Post: 06-26-2013, 06:31 AM
  2. Forms Navigation Bar on every form
    By dhogan444 in forum Forms
    Replies: 2
    Last Post: 12-03-2012, 06:19 PM
  3. Integrating 3 forms into 1 form
    By JFo in forum Forms
    Replies: 12
    Last Post: 11-07-2011, 02:39 AM
  4. Two forms opening the same form
    By MikeMairangi in forum Forms
    Replies: 5
    Last Post: 08-31-2011, 01:55 PM
  5. Replies: 1
    Last Post: 11-12-2010, 06:33 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