Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2001
    Posts
    175

    Question Unanswered: Updating a field in various forms

    I want to be able to enter information on several forms. (For example, I have a form with buttons that when clicked would open other forms in which info is entered) From the info entered on the various forms I want to produce an Invoice (a report) with a system generated invoice number.

    My problem is - how can I update the various tables from which the forms were created with the system generated invoice number?????

    Any help would be appreciated.....

  2. #2
    Join Date
    Jan 2003
    Location
    Vietnam
    Posts
    188

    Re: Updating a field in various forms

    Originally posted by toukey1
    I want to be able to enter information on several forms. (For example, I have a form with buttons that when clicked would open other forms in which info is entered) From the info entered on the various forms I want to produce an Invoice (a report) with a system generated invoice number.

    My problem is - how can I update the various tables from which the forms were created with the system generated invoice number?????

    Any help would be appreciated.....
    am quite confused with your question. do you have prob retrieving the system generated number (used as invoice number) for the report (invoice)???
    qha_vn

  3. #3
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    I f I understand correctly you have form A and form B

    both are visible in the workspace

    You want to enter data on both forms and then click a button to generate the invoice - gathering data from both forms.

    In order to best provide a solution I need to know if the forms are unbound or have an underlying recordsource - and if they do have an underlying recordsource - are they bound to the same table(s)?

    Does one form close before the other is opened?

  4. #4
    Join Date
    Sep 2001
    Posts
    175
    Form A and B are based on different tables but I have set a relationship between the two by the invoice no. and client no. (which should make it unique). A button is pressed on Form A to open Form B. When you exit Form B, you are returned to Form A. I want to be able to pass the invoice no from Form A to Form B and have it saved in that table.

    Is this possible???

  5. #5
    Join Date
    Jan 2003
    Location
    Vietnam
    Posts
    188
    Originally posted by toukey1
    Form A and B are based on different tables but I have set a relationship between the two by the invoice no. and client no. (which should make it unique). A button is pressed on Form A to open Form B. When you exit Form B, you are returned to Form A. I want to be able to pass the invoice no from Form A to Form B and have it saved in that table.

    Is this possible???
    yes, its possible

    in form A you need to have a bound textbox (or something likes that, having controlsource property refer to the related field in the table). lets name it textboxA

    in form B you also need a textbox (called textboxB) when create a new invoice on form B, textboxB holds this value. When you exit form B write vb codes (simple!) to set the value (invoice number) from textboxB to textboxA before closing the form.

    if you dont know how to refer to a certain opening form and its controls, just enter "refer to a form" in ms help search.

    hope this helps
    qha_vn

  6. #6
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    you may also want to use the isloaded function behind the close event of the second form to avoid runtime error in passing values to a control on a form that may not be open or at least handle the error for that - remember users have a tendency to discover how to navigate the app in the least intended way

  7. #7
    Join Date
    Sep 2001
    Posts
    175
    Thanks - will give it a go!

Posting Permissions

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