If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Adding fields
I'm running a MakeTableQuery (if that is the proper translation from
Dutch) to create a new table after export of a batch of ASCII-data from a different application, which is linked to the database. This replaces each time the table that was used before, which is a pity because several fields have to be added to that table. So far this has been done manually. How can it be done in VB? I have added some lines to the button code to get this done automatically, but I cannot find the proper expression for a selection (tick?) box (selectievakje?). So, something similar to: DoCmd.OpenQuery "A5-A6_keuze" Dim db As DAO.Database Dim tbl As DAO.TableDef Dim fld As Field Dim fld2 As Field Dim Veld5 As Field Set db = CurrentDb Set tbl = db!janus Set fld = tbl.CreateField("A5", dbBoolean) Set fld2 = tbl.CreateField("A6", dbBoolean) tbl.Fields.Append fld tbl.Fields.Append fld2 db.Close This works but the Boolean type gives a 0 or 1, not a selection box (that little square that you can tick). Appreciate any help! |
#2
|
|||
|
|||
On Mon, 03 Jan 2005 21:37:57 GMT, Dodo2u
wrote: This works but the Boolean type gives a 0 or 1, not a selection box (that little square that you can tick). Two suggestions: - Don't bother using table datasheets for data entry. They're not well suited for that purpose. Use a Form; on the form you can use a checkbox control bound to the Boolean field (or a textbox, or a combo box, or...) - Rather than running a MakeTable query and then patching up the table afterward, consider creating a table with the needed fields; run a Delete query to empty it followed by an Append query to load it with the data from the textfile. John W. Vinson[MVP] |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
refreshing field list after adding fields to a table | Colorado | General Discussion | 5 | October 28th, 2004 09:36 PM |
Adding new fields to existing forms | Alan in Canterbury | Using Forms | 1 | August 19th, 2004 11:47 AM |
Adding new fields to an existing form/subform | Linda | New Users | 4 | August 7th, 2004 12:03 AM |
Adding several fields to arrive at a sum | Chris Christian Read | Using Forms | 2 | August 5th, 2004 10:12 PM |
Adding fields in a table | tpitman | General Discussion | 0 | June 20th, 2004 05:08 PM |