Results 1 to 5 of 5
  1. #1
    joecamel9166 is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Feb 2016
    Posts
    85

    Display field based on selected criteria

    Not really sure where to post this question. This is for a repair DB. I Have a couple tables linked by model number. Each model# has 4 versions. Each version has 3 repair classes (a, b, c). Each version has a different price for each repair class.



    Right now on my main units table i have a model field, repair class field and an estimate field. The model field has a direct relationship to a modelnumber table.

    The modelnumber table contains all models and versions in a field along with their corresponding Aclass, Bclass, Cclass price.

    On my form I want to input the Aclass, Bclass, or Cclass value of the modelnumber table into the estimate field of the main table depending on the model field value and the repair class value of the main table.

    I can't imagine this being too complicated, but I'm at a complete loss on how to achieve this. Maybe I'm going at it the wrong way?

    I sincerely appreciate any help on this. Thanks!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    You can show the continuous form, text or combo boxes on the header.
    every time a box changes, the AFTERUPDATE event changes the filter.
    Code:
    sub cboBox_Afterupdate()
    RunFilter
    end sub
    
    sub RunFilter()
    Dim sWhere
       If not IsNull(cboBox) then sWhere = " and [field]='" & cboBox & "'"
       If not IsNull(txtBox) then sWhere = " and [field]='" & txtBox & "'"
    SWhere = mid(sWhere,6).  'Remove 1st AND
    me.Filter=sWhere 
    me.FilterOn=true
    End sub

  3. #3
    joecamel9166 is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Feb 2016
    Posts
    85
    Thank you!
    Please excuse my ignorance, but what would the reason for having the text boxes displayed in the header be?

    Currently the text boxes are on the form bound to main units table. The model# is selected on the previous form, and I have a combo box on current form with values a, b, c(repair class) . If I used the afterupdate on the repair class combo box, would that work also?

    Im not at work now, so I can't physically try your solution at the moment. I just want to get a good understanding of it.

  4. #4
    joecamel9166 is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Feb 2016
    Posts
    85
    I still Cant figure this out. Maybe my relationships are not correct.
    I compressed my DB and uploaded it to drop box. Here is the link. https://www.dropbox.com/s/l64t9qxq3s...x.com.url?dl=0
    Don't mind the mock data that's in it.
    Please any help on this would greatly appreciated.

  5. #5
    joecamel9166 is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Feb 2016
    Posts
    85
    What I think I need on this is a statement like this on my quote form:
    Code:
    If Me.Repair_Class = "A" Then
    Me.Estimate = ("modelID.ClassA")
    End If
    I just don't know the proper syntax to do this.

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

Similar Threads

  1. Display Msg box based on Query criteria
    By vad77 in forum Forms
    Replies: 6
    Last Post: 02-17-2016, 08:15 AM
  2. Replies: 3
    Last Post: 12-03-2014, 01:40 PM
  3. Printed report based on selected criteria
    By handsomealso in forum Reports
    Replies: 4
    Last Post: 04-18-2013, 08:43 PM
  4. Query Criteria Based on Item Selected???
    By P.Malius in forum Queries
    Replies: 5
    Last Post: 04-16-2013, 02:09 AM
  5. Replies: 3
    Last Post: 01-17-2012, 01:04 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