Results 1 to 13 of 13
  1. #1
    travelmedic is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2022
    Posts
    10

    Post Using a form to do 2 separate tasks

    I have a form that I can input info into, and have it save to a table.



    I wanted to know if I could also have the same form pull up the info and modify it. Like if I input employee info into the form, I would like to be able to go back to the same form, search for an employee, and update any info I need too.

    Right now the form shows 1 or 1 record, but the table associated with the form has all the records listed.

  2. #2
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,425
    Very possible.
    Is it a single form (only shows one record) but you can navigate to other records, or is it some other type?
    Are you opening it in a Data Entry mode (can only see one new record and no prior ones)?
    Does the form recordsource return more than one record (is that a query?) or did you bind it (link) to a table instead?

    Might be quicker if you just copied the db, compacted then zipped it and post the copy here.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    travelmedic is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2022
    Posts
    10
    It's a single form that opens up to a new record and you can't see any other prior records. You can't navigate to other forms, it only shows 1 of 1 record. I guess it's bound to a table.

    Quote Originally Posted by Micron View Post
    Very possible.
    Is it a single form (only shows one record) but you can navigate to other records, or is it some other type?
    Are you opening it in a Data Entry mode (can only see one new record and no prior ones)?
    Does the form recordsource return more than one record (is that a query?) or did you bind it (link) to a table instead?

    Might be quicker if you just copied the db, compacted then zipped it and post the copy here.

  4. #4
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,425
    You must have its Data Entry property set to yes. If you want to open it that way sometimes but not always, then something (e.g. button click, combo selection, option button, etc.) needs to tell your code Open Event what form properties you want to set at that time. This is the way to do it - not make multiple identical forms to different things.

    If you want records for employee and there are not too many of them, a combo (only allows 1 choice) or listbox (can allow several choices) could be used to retrieve records for the one(s) chosen. Maybe that would go in the form header - maybe that choice should be made on some sort of selection form that tells this form how to open and what to load. Many ways to do this. If you don't want to post a db, perhaps Google something like "ms access how to open a form several ways" or something similar. Here's but one
    https://stackoverflow.com/questions/...-using-buttons

    Note that you need to affect form properties that will either open to only add records, or view them instead. Some code samples you'll find only show how to filter records, and that isn't good enough for this.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,574
    Quote Originally Posted by travelmedic View Post
    I have a form that I can input info into, and have it save to a table.

    I wanted to know if I could also have the same form pull up the info and modify it. Like if I input employee info into the form, I would like to be able to go back to the same form, search for an employee, and update any info I need too.

    Right now the form shows 1 or 1 record, but the table associated with the form has all the records listed.
    That is how I have always used my forms?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  6. #6
    travelmedic is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2022
    Posts
    10
    The data entry property is set to no. Right now I don't have a lot of employees entered, but I will have over 200 employees entered. I can't get the db to compact enough to fit the file size for this forum



    Quote Originally Posted by Micron View Post
    You must have its Data Entry property set to yes. If you want to open it that way sometimes but not always, then something (e.g. button click, combo selection, option button, etc.) needs to tell your code Open Event what form properties you want to set at that time. This is the way to do it - not make multiple identical forms to different things.

    If you want records for employee and there are not too many of them, a combo (only allows 1 choice) or listbox (can allow several choices) could be used to retrieve records for the one(s) chosen. Maybe that would go in the form header - maybe that choice should be made on some sort of selection form that tells this form how to open and what to load. Many ways to do this. If you don't want to post a db, perhaps Google something like "ms access how to open a form several ways" or something similar. Here's but one
    https://stackoverflow.com/questions/...-using-buttons

    Note that you need to affect form properties that will either open to only add records, or view them instead. Some code samples you'll find only show how to filter records, and that isn't good enough for this.

  7. #7
    travelmedic is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2022
    Posts
    10
    How? because I've been trying and it's not working

    Quote Originally Posted by Welshgasman View Post
    That is how I have always used my forms?

  8. #8
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,425
    I can't get the db to compact enough to fit the file size for this forum
    Did you zip the file first?
    Might be quicker if you just copied the db, compacted then zipped it and post the copy here
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  9. #9
    travelmedic is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2022
    Posts
    10
    I deleted a bunch of data for the copy in order for the file to zip to a much smaller file size

    Quote Originally Posted by Micron View Post
    Did you zip the file first?

  10. #10
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,425
    I've reviewed all your posts thinking "why don't I even know which form to look at let alone exactly what to do with it"? thinking it's just me.
    As much as I like to help everyone, please don't hold back information. If we (no, not just me) have to extract info like a dentist pulls teeth, it becomes easier to just move on.
    Have lost valuable time now as I'll soon be out for the night.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  11. #11
    travelmedic is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2022
    Posts
    10
    Sorry for wasting your time then

  12. #12
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,574
    Quote Originally Posted by travelmedic View Post
    How? because I've been trying and it's not working
    Generally I pass in the criteria for the record(s) I want. I also pass in the same as OpenArgs(), so if no such records exist yet, then I have a new record and can set the values from the OpenArgs, if going from one form to another.
    Or just press the New record button in the navigation buttons if just using a simple form.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  13. #13
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,742
    OP removed the original submitted DB. I got it before that, made mods and uploaded the rev here. Since OP removed original DB, I feel that I should remove my modified version also. And so it goes...
    Last edited by davegri; 03-21-2022 at 04:08 PM.

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

Similar Threads

  1. Replies: 3
    Last Post: 04-26-2016, 10:40 AM
  2. How to separate names into 2-separate fields
    By djclntn in forum Queries
    Replies: 4
    Last Post: 09-18-2014, 02:34 PM
  3. Replies: 5
    Last Post: 07-18-2014, 02:04 AM
  4. Replies: 5
    Last Post: 07-10-2014, 09:37 AM
  5. Adding a list of tasks (at once) in a form
    By mooseisloose in forum Forms
    Replies: 8
    Last Post: 03-22-2011, 09:27 AM

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