Results 1 to 8 of 8
  1. #1
    joym is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Feb 2017
    Posts
    57

    Post Matching data from a drop down to a column in a table

    I have created a table SLA with no primary key it has 5 columns with distances for headings and locations that fall within that distance from location x



    Ten 10-50 50-80 80-100 100
    a1 b1 c1 d1 e1
    a2 b2 c2 d2 e2
    a3 b3 c3 d3 e3
    a4 b4 c4 d4 e4
    a5 b5 c5 d5 e5
    a6 b6 c6 d6 d6

    I have a form with a field date and time fault lodged that captures the current date and time eg: 2/14/2017 10:34:00 AM, i have a cascading drop down list to select a site based on region and site. As soon as you select a site i want the site to be matched to one of columns and
    if Site x falls on column Ten then in another text field Resolution Time Frame add 2 hours to the time and display the new date and time
    if Site x falls on column 10-50 then in another text field Resolution Time Frame add 4 hours to the time and display the new date and time
    if Site x falls on column 50-80 then in another text field Resolution Time Frame add 8 hours to the time and display the new date and time
    if Site x falls on column 8-100 then in another text field Resolution Time Frame add 2 days to the date and display the new date and time
    if Site x falls on column 100 then in another text field Resolution Time Frame add 10 days to the time and display the new date and time

    i could only come up with this and i am stuck

    Code:
    If (DLookup(Ten, SLA, "me.cboSite=Ten")) Then

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Not really enough info to give a good answer.

    I have a form with a field date and time fault lodged that captures the current date and time eg: 2/14/2017 10:34:00 AM,
    Got it...

    i have a cascading drop down list to select a site based on region and site.
    Got it... two combo boxes

    As soon as you select a site i want the site to be matched to one of columns
    Don't got it......the site selected should match with a field in table "SLA".. Which field??


    What does the data look like in the table "SLA"?
    Can you give a site and the expected results?
    Describe how you go from a "site" to get a distance form "x"...........

    BTW, the field names "10-50", "50-80", etc are terrible field names. If you really want to keep the distances, then the field names I would use would be "D10_50", "D51_80", "D81_100" and "D101". Note the underscore instead of the hyphen.
    Object names should be letters and numbers (exception is the underscore). No spaces, punctuation or special characters.


    Or maybe you would post the dB??

  3. #3
    joym is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Feb 2017
    Posts
    57
    Hi I mean the site to be matched to one of the columns in the table SLA. eg if site selected is e5 then the equation should verify if here is a matching text in that column wid the same characters (casing does not matter) data in the sla table are names of places or a company site eg. Brown Street or Auckland exchange/rss.
    i used google map to find the distance from Location x to every site and categorized it in the table accordingly.

    Thanks for the tip i will change the i am fairly new with access thus the error.

    if there is a better way of going about this i am open to suggestions

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Really helpful if you provide examples.

    Remember, you probably have been working with this for a while..... we have not and know nothing about your dB or what you are trying to do.

  5. #5
    joym is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Feb 2017
    Posts
    57
    What i am trying to achieve is something similar to when someone creates a Access login screen. There is a table with the username and password. when Someone enters the credentials it is verified to the table with the all the user names and corresponding passwords to check if the user names is correct and the corresponding password is correct then it allows you to access all other forms within that DB.

    This is my form

    Click image for larger version. 

Name:	x.jpg 
Views:	11 
Size:	75.4 KB 
ID:	27506

    This is a fault lodgement form. You Enter the the fault date and time. Select the Region. Select the area. Select the Site. When you select the site the site has to be matched to a list of sites in one of the columns in the SLA table. Depending on which column in the SLA the selected site in the form falls in, a calculation has to be done to calculate the resolution time frame (Time by which the fault should be rectified). the calculation takes into account the site selected verifies it to which column it falls on and certain time to the time fault was lodged to give the Resolution Time Frame. Lets Say the site Selected is X.

    if Site x falls on column Ten then in another text field Resolution Time Frame add 2 hours to the time and display the new date & time in the Resolution Time Frame Text box

    if Site x falls on column 10-50 then in another text field Resolution Time Frame add 4 hours to the time and display the new date and time in the Resolution Time Frame Text box

    if Site x falls on column 50-80 then in another text field Resolution Time Frame add 8 hours to the time and display the new date and time in the Resolution Time Frame Text box

    if Site x falls on column 8-100 then in another text field Resolution Time Frame add 2 days to the date and display the new date and time in the Resolution Time Frame Text box

    if Site x falls on column 100 then in another text field Resolution Time Frame add 10 days to the time and display the new date and time in the Resolution Time Frame Text box

  6. #6
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    So site "Lambi BTS" will be in table "SLA" once in one of the fields?

    It really sounds like the table "SLA" is designed like a spreadsheet. (especially with the example in Post #1)

    Would you post the dB or a picture of the table? I know you kind of showed the table on Post #1, but it would be helpful with actual data instead of a1, b1, c1, ...

  7. #7
    joym is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Feb 2017
    Posts
    57
    u are right it is designed like an excel spreadsheet
    and yes each site only appears once in the SLA table
    Click image for larger version. 

Name:	xx.jpg 
Views:	10 
Size:	142.6 KB 
ID:	27508

  8. #8
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    So I would change the structure of the SLA table to

    SLA (- table name)---------------------
    SLA_PK - Autonumber
    SiteName - Text
    Distance - text


    Find the site name and you have the distance. then calculating the time will be easy.

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

Similar Threads

  1. Replies: 5
    Last Post: 08-25-2015, 08:39 AM
  2. Replies: 1
    Last Post: 08-08-2015, 10:34 AM
  3. Replies: 6
    Last Post: 12-15-2014, 07:53 PM
  4. Replies: 3
    Last Post: 03-07-2014, 10:39 AM
  5. Different Values in Drop Down Menu and Data Table
    By colourxpalette in forum Forms
    Replies: 4
    Last Post: 05-22-2013, 02:40 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