Search results

  1. T

    Help using Form to Insert new record into a Table

    I was testing a button in a form with an OnClick event. I wanted to see if I could use a form to insert a new record into a table, I tried the following but got a Syntax Error: INSERT INTO Table1 (Org, Date, Name) VALUE ('#Me.Org#', #Me.Date#, '#Me.Name#') Org and Name fields are text fields...
  2. T

    Help with attaching a code to a button, please

    Many thanks for your observations. The reason for this "flat" design was because the services are rarely similar and there is no foreseeable need to search by the service. However, I chose this flat design to meet the limitations of the mail merge feature in MS-Word...which comes next. Thanks...
  3. T

    Help with attaching a code to a button, please

    Thanks for your quick response. The numbered items go up to 10...5 more than that is actually required...just in case. As such no further numbered items are needed. There are other codes that are used to lookup fields from another table, embedded fields are used to create customized embedded...
  4. T

    Help with attaching a code to a button, please

    I have a form in which all the fields are "unbounded" to any table. Thru the use of other codes and data entry, the fields are now filled. I now need to save all the fields as a single record into a table. I believe I need a "Save" button that will run the code below. Three questions: 1. Will...
  5. T

    Help with a text field & a Date field, please

    Many thanks for the useful info. Using your advice, I managed to get it working with the following modified code. ===================================== Private Sub Form_Current() GetInvNum End Sub Private Sub Invoice_Date_AfterUpdate() GetInvNum End Sub Sub GetInvNum() If...
  6. T

    Help with a text field & a Date field, please

    Many thanks for that. It works beautifully in your sample MDB file. I made some modifications to your code and tried it but got an error msg: Runtime error '94' Invalid use of Null ====================================== Private Sub Form_Current() GetInvNum End Sub Private Sub...
  7. T

    Help with a text field & a Date field, please

    I have a [OrgCode] text field and a [InvDate] dd/mm/yyyy field. My third field [InvNum] needs to be automatically filled in with the first 3 chars of [OrgCode] and mmdd of the [InvDate] field. Here's an example: "CASTOR" in [OrgCode] & 15/01/2007 in [InvDate] I need "CAS0115" in [InvNum] as...
  8. T

    Need to fill calculated date into a field

    I have two fields: [NoDays] & [InvDate]. An integer, such as 14 for [NoDays] and dd/mm/yyyy for [InvDate]. A third date field, also dd/mm/yyyy for [EndDate] needs to be filled in with [InvDate] plus the [NoDays]. I tried After update Event: Me.EndDate = Me.InvDate + Me.NoDays It does not...
  9. T

    How to save Unbound Form into Access table as a Record, please

    Having used After Update event in an Unbounded form, I've managed to populate some fields from an Access table. After filling in the rest of the fields, I want to save all the fields on the form into another existing table as a record. Can this be done? If so, please advise. Many thanks.
  10. T

    Populate form fields from Access table using VBA

    Hi Stopher. Except for a Compile error and data member not found, the Update is trying to run. I'd appreciate it if you could look at the code below and let me know if it's doing what I think it should be doing, please: ========== Set db = CurrentDb Set rs = db.OpenRecordset("Select * FROM...
  11. T

    Populate form fields from Access table using VBA

    Phew! Many thanks for the assurance!
  12. T

    Populate form fields from Access table using VBA

    Hi Stopher. I realise that I'm going against the grain of relational design but I find the need to save the form with some duplicate data. Once saved into the Invoices table, MS-Word is used to mail merge with the table to print out the invoices. Many thanks for the info about the After Update...
  13. T

    Populate form fields from Access table using VBA

    Many thanks, Dsigner. You've been very helpful.
  14. T

    Populate form fields from Access table using VBA

    Thanks for your help. When I finally get the code working, my guess is that I should create a macro for it. I'd like to know how I can create a macro and add the button to the toolbar, please. Thanks.
  15. T

    Populate form fields from Access table using VBA

    That's precisely what I'm trying to do. By typing a code in the [Organisation Code] field in the form, I'm trying to populate 13 other fields from a record in a table. I can then complete the rest of the fields and save as a new record. Am I on the right track? Thanks...
  16. T

    Populate form fields from Access table using VBA

    Wow! Thanks for the info. Basically, the form is used to add new records. By typing an [Organisation Code], I'm hoping that 14 fields would be automatically filled in from the Organisation table...a great time saver. After that, I can fill in the other fields and save the record. The Invoices...
  17. T

    Populate form fields from Access table using VBA

    I have two tables: Invoices & Organisations. A form called Invoices contains a field [Organisation Code] that is used to populate about 14 fields in the 65-fields form. The form is unbound (no Record Source) & so are its fields. With some help, I've gone as far as to develop the following VBA...
Back
Top Bottom