Results 1 to 8 of 8
  1. #1
    jheintz57 is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    28

    Conditional Responses in Form


    I have one main form, frm_Manifest that has 2 yes/no boxes. if one box is checked, I have frm_RCRA opening, if this box is not checked, and the other yes/no is, I have another form opening. There are instances where both boxes will be checked. Where these happen, I am getting an error saying I cannot edit that value.

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    It would probably help to see the code, and at what point you get the error.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    jheintz57 is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    28
    The error is coming up in the receiving form:

    Private Sub Form_Load()
    If Not IsNull(Me.OpenArgs) Then
    Me.Manifest_ID = Me.OpenArgs
    End If
    End Sub

    The sending form has this:

    Private Sub Manifest_Continue_Click()

    Dim stForm As String
    Dim stDocName As String
    Dim stTable As String
    Dim stID As String
    Dim intCounter As Integer


    If Me.[solid_waste?] = True Then

    stForm = "frm_RCRA"
    stTable = "tbl_RCRA_inventory"
    stID = "RCRA_ID"

    Else

    stForm = "frm_DOT"
    stTable = "tbl_DOT_inventory"
    stID = "DOT_ID"

    End If


    intCounter = IIf(IsNull(DCount(stID, stTable, "[Manifest_id]=" & Me.Manifest_ID)), 0, DCount(stID, stTable, "[Manifest_id]=" & Me.Manifest_ID))

    Select Case intCounter

    Case Is = 0
    DoCmd.OpenForm stForm, , , , , acFormAdd, Me.Manifest_ID


    Case Is >= 1
    DoCmd.OpenForm stForm, , , "[Manifest_ID] =" & Me![Manifest_ID]

    End Select

    Exit_select_site_Click:
    Exit Sub

    End Sub

  4. #4
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    So the error is in the load code with the OpenArgs? Is the source of that form editable? What is the control source of

    Me.Manifest_ID
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    jheintz57 is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    28
    It is the Manifest_ID carried over from the previous form. When a certain project is selected in the previous form, a manifest is created in a subform. That Manifest_ID is from that subform. There isn't already an Manifest_ID for that project, one is created, if there is, it is opened in the subform which is where one checks the appropriate boxes mentioned before. There is a Manifest_Continue button that opens either the frm_RCRA or the frm_DOT depending on if the solid_Waste? box was checked. The Manifest_ID in the second form should not be allowed to be edited unless a new one has to be created.

    Hope I am not totally confusing.

  6. #6
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    Can you post the db?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    jheintz57 is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    28
    I would rather just send it directly to you if need be and not post online.

  8. #8
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    You can send it to

    pbaldy
    gmail
    com
    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. Conditional Formatting
    By cevatyildiz in forum Forms
    Replies: 8
    Last Post: 04-30-2010, 12:01 PM
  2. Conditional Formatting (on Open form?)
    By christopheb in forum Forms
    Replies: 0
    Last Post: 03-16-2010, 07:07 AM
  3. Averaging with a conditional check
    By sarah in forum Queries
    Replies: 1
    Last Post: 10-05-2009, 05:11 AM
  4. count with conditional
    By humpz in forum Reports
    Replies: 3
    Last Post: 08-02-2009, 08:11 AM
  5. Conditional formatting
    By ylivne in forum Reports
    Replies: 1
    Last Post: 07-12-2009, 06:18 PM

Tags for this Thread

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