Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2004
    Location
    Gulfport, MS
    Posts
    2

    Exclamation Unanswered: Adding Records To A Table Using VB Code

    Hey,

    I have a table titled "Customers" and once a week they are required to "call-in" to the main office. I have created another table titled "CallInLog". I created a form that needs a command button to "Create" a blank log entry in table "CallInLog" for each Customer in table "Customers".

    This new log entry has the Customer's Name, Date to Call by (7 days from beginning date) and a check box that the user can check as they call in. When checked, the final field will hold the "date called" and the date they called will be inserted there. I have completed the forms and the only question I have is how to create the records in table "CallInLog" for each entry in "Customers" when the "Create New Log Records" button is clicked by the operator.

    Any Help with this one?

    Thanks !!

  2. #2
    Join Date
    Mar 2004
    Location
    belgium
    Posts
    290
    an on click event

    recordset.append
    - add field values
    recordset.update

  3. #3
    Join Date
    Feb 2004
    Location
    Gulfport, MS
    Posts
    2

    Exclamation Thanks for the quick response

    Thanks, however I still do not know the structure or series of commands that I need to use. Could you explain in a little better detail? Thanks a heap!!

  4. #4
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Lightbulb

    PHP Code:
      Dim rs As RecordSet
      SET rs
    CurrentDB.OpenRecordset("SELECT * FROM yourTableName"dbOpenDynaset)  ' Dynaset to enable UPdating

      If rs.EOF and Rs.BOF then
         Msgbox "File is Empty"
      Else
        rs.MoveLast
      End If

       rs.AddNew
         rs("a FieldYouWantToEnter") ="its Value as String"     
         rs("another FieldYouWantToEnter") =its Value as Number
       rs.Update 
    Hope that could help

Posting Permissions

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