Results 1 to 5 of 5
  1. #1
    najathsl is offline Novice
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    6

    Question :confused: Creating a datasheet from a SQL string using VBA

    Hi Guys ..

    i am creating a dynamic table with dynamic new columns to table.

    what i want to do is.

    I wanted to create a datasheet view (form) using that table or a dynamic column values every time i modify the table.



    please help me ..



    Najath

  2. #2
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,044
    Hi,

    you can easily create an empty form with 1 subform control. just assign the table name to the Source object property (like Table.tblMyTable), and it will show the table with wathever columns yiu created in it.

    greetings
    NG

  3. #3
    najathsl is offline Novice
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    6

    Question Hi Noella, Thanks .. but ..

    what i am trying to do is ,

    i am creating Tables Runtime, that part is successful , now i need to assign those RUNTIME tables to forms and create the table in RUNTIME.

    see, thats the part i am struck

    please advice me.

    Najath

  4. #4
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,044
    To create a form by code: you can try something like:

    Public Sub CreateMyForm()

    Dim frm As Form
    Dim ctlLbl As Control
    Dim ctlTxt As Control

    Set frm = CreateForm()
    frm.RecordSource = "tblMyTable"
    Set ctlTxt = CreateControl(frm.Name, acTextBox, , "", "", 1200, 100)
    ' Create label for text box.
    Set ctlLbl = CreateControl(frm.Name, acLabel, , ctlTxt.Name, "NewLabel", 100, 100)
    DoCmd.Save acForm, frm.Name
    DoCmd.Close acForm, frm.Name


    End Sub

  5. #5
    najathsl is offline Novice
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    6

    thanks alot..

    thanks alot...

    god this is what i being looking for ... thank you very much..

    najath

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

Similar Threads

  1. Datasheet and Code
    By dbprogman in forum Forms
    Replies: 7
    Last Post: 07-26-2010, 07:39 AM
  2. Datasheet View
    By Evgeny in forum Programming
    Replies: 6
    Last Post: 04-28-2010, 10:17 AM
  3. Filter by Form? Confused...
    By andmunn in forum Forms
    Replies: 0
    Last Post: 01-14-2010, 01:30 PM
  4. Form - Datasheet View
    By kalove in forum Forms
    Replies: 0
    Last Post: 06-20-2007, 11:29 AM
  5. Creating a string from all records in a table
    By ocordero in forum Programming
    Replies: 2
    Last Post: 08-07-2006, 09:21 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