Results 1 to 4 of 4

Thread: Newbie question on Forms : 4 entries per form page

  1. #1
    Join Date
    Jun 2009
    Posts
    2

    Newbie question on Forms : 4 entries per form page

    So I know this can be done, I can do this elsewhere but need to do this in Access 2007, which is new to me -- any help greatly appreciated.

    Each row in the database has 5 fields: ID, Timeslot, Type, SubType, and Entry. The first 4 are lookups, Entry is free numeric entry.

    On a form page, I need to have 4 entry boxes display, with each one associated with a different SubType (so that when the fields are inserted into the db, entry1 gets entered as SubType1, entry2 as SubType2 etc). All 4 entries will be entered as the same timeslot. And the page itself will determine the Type the entries are associated with.

    Two controls (which I know how to do) will get you to the next/prev timeslot or the next/prev Type.

    But I'm not sure how to get 4 entries on a form (so 4 different database records, ultimately) all to 1) be associated with a particular SubType and 2) be entered based on a single keypress.

    Possible/likely? If not, dammit but if so, any tips?

    Again, many thanks for any help here.

  2. #2
    Join Date
    May 2006
    Posts
    407
    Could you explain these four records a little bit more? Will these 4 records be in separate tables, or will they all be in one table? If in one table, it seems like these 4 different records will at least have a code in each record to define which of the 4 records this one is.

    After typing the above, I thought this might help if I have guessed correctly about how you are coding the records.

    Create a separate subform for each of the 4 different records, and if you have a code in each record to signify which of the 4records you want to deal with, then that code can be used to keep the records coming into each separate subform to be just the type of records you want.

  3. #3
    Join Date
    Jun 2009
    Posts
    2
    Thanks, not familiar with subforms to a great extent but will look into them -- I'm not entieely clear on the idea you propose but I think I have a rough sense.

    Each record is in a single table, the type/subtype & timeslot are all lookup fields in the first 3 columns, only the last field (entry) is freeform. Think of it as a cascade - the page determines the first field (type) so all entries made from that page will have that field set to type1 say. The timeslot (3rd field) will also be the same on each page so all entries will have their timeslot set to the same value. The 4 entry fields though will be different, and each one of those must be associated with a particular subtype - so the first entry box is always going to have the 2nd columns set to subtype1, the second to subtype2... I'm just not sure how to 'bind' them so to speak.

    I assume I have to handle that in the code rather than in the form design.

    Many thanks for your help, looking into subforms now (or soon anyway)

    Gip

  4. #4
    Join Date
    May 2006
    Posts
    407
    I'm thinking it would be good to, if possible, review the overall design of what you are wanting to accomplish. I've been working with Access for over 15 years, and in "the business" for over 30 years, and I have not heard of something with so few fields that would be so complicated as your data entry sounds. That is why I'm thinking a review of the overall design of your system would be a really good starting point.

    Here are some general pointers for subforms.
    Any fields that are used to "bind" the data records in a subform with the master record in the main form will be automatically filled with the matching data. In other words, if the main form has "type1" in fldOne and fldOne is the matching (or one of the matching) field between the main form and the subform, then "type1" will be automatically inserted into that field in the subform.

    Now the lookup fields. If the available lookup data in fldTwo is a subset based on the contents of fldOne, then set the AfterUpdate event for fldOne so as to execute a statement like this: fldTwo.Requery
    This way, whenever you change the data in fldOne, the available data to choose in fldTwo will only be the subset it should be. That cascading concept would be done with any other "cascading" fields on the form.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •