#1
  1. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Oct 2012
    Posts
    21
    Rep Power
    0

    Multiple use fields in a form


    Hi guys,
    I currently have a database where I can make an invoice by filling out all the required fields.
    However when it comes to choosing a client to send the invoice to I currently have it set so when I select an option from a combo box it fills in the fields automatically, however I would like it so I could also enter a new user in the fields and have it saved to the Clients table and then have it selectable from the combo box at a later date.
    How would I go about having a multi use field like this? I've tried doing =[cmboAccNo].[column](1)!ClientName to see if it can reference both fields, but I thought this was a silly idea and presumed it needed some VBA code, which I am terrible with

    The current fields for the client table are;
    Code:
    pk_ClientAccountNumber
    ClientName
    ContactFirstName*
    ContactLastName*
    AddressLine1
    AddressLine2
    AddressLine3
    City
    Postcode
    PaymentTerms
    ContactNumber*
    ContactEmail*
    Fields with a * aren't used in the form but for billing inquires at a later date
    Also I have the Query [Forms]![Create Invoice]![InvoiceNumber] which I use to open a report based on the invoice number I type in, which in turn shows a completed invoice, however in the dialogue box that pops up it shows the query code, is there any way I can change it to show something like "Please enter an invoice number" instead of the query code
  2. #2
  3. Contributing User
    ASP Adventurer (500 - 999 posts)

    Join Date
    Feb 2008
    Location
    Lake County, IL
    Posts
    865
    Rep Power
    152
    this link should get you started in the right direction

    Microsoft Access tips: Adding items to a combo/list box
    Alan Sidman
    Office 2010, 2007, 2002

    If I helped you, then click "give rep" button in the lower left corner.
  4. #3
  5. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Oct 2012
    Posts
    21
    Rep Power
    0
    Thankyou Alan,
    I used the "Using another event to open a form" method and this seems the easiest way of doing it
  6. #4
  7. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Oct 2012
    Posts
    21
    Rep Power
    0
    Sorry for the double post. I can't edit my posts but,
    It's probably worth mentioning that on the double click event I changed:
    Code:
            Else
                'Combo was blank, so go to new record.
                RunCommand acCmdRecordsGoToNew
            End If
    to
    Code:
            Else
                'Combo was blank, so go to new record.
                DoCmd.GoToRecord , , acNewRec
            End If
    As the the original part was throwing up errors but the new code seemed to fix it.

    I am also having an error with a Save and Close button. When I click it an error message appears stating "Error 2467: The expression you entered refers to an object that is closed or doesn't exist."
    and then only has an OK button, this only seems to appear when I type something into the form then try to save and close. However the data is still saved to the table and can still be selected from the combo box
  8. #5
  9. Contributing User
    ASP Adventurer (500 - 999 posts)

    Join Date
    Feb 2008
    Location
    Lake County, IL
    Posts
    865
    Rep Power
    152
    Post your code for the Save and Close Button.

    In the meantime, google your error code.
  10. #6
  11. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Oct 2012
    Posts
    21
    Rep Power
    0
    The button is only a built in macro, so I can't figure out why it's giving me errors I've googled the error code and it seems to be a bug but I don't see any work around for it

Similar Threads

  1. Multiple DDLs populating different fields in a form
    By foundsheep in forum .NET Development
    Replies: 0
    Last Post: February 14th, 2008, 11:38 AM
  2. 1 form, 2 tables, 1 field to multiple fields
    By lanqy in forum Microsoft Access Help
    Replies: 2
    Last Post: July 1st, 2005, 12:14 PM
  3. Summing across multiple fields in a Form
    By xjds in forum Microsoft Access Help
    Replies: 0
    Last Post: December 28th, 2004, 06:36 PM
  4. Using a button to add text in multiple form fields
    By twopecker in forum ASP Development
    Replies: 5
    Last Post: May 31st, 2004, 11:50 PM
  5. Updating multiple records from form fields
    By Steve Schofield in forum SQL Development
    Replies: 0
    Last Post: December 20th, 2001, 12:00 PM

IMN logo majestic logo threadwatch logo seochat tools logo