[AccessD] adding field to table via code

Andy Lacey andy at minstersystems.co.uk
Wed Feb 5 14:45:00 CST 2003


No space before Createfield

Andy Lacey
http://www.minstersystems.co.uk



> -----Original Message-----
> From: accessd-admin at databaseadvisors.com 
> [mailto:accessd-admin at databaseadvisors.com] On Behalf Of 
> Oleg_123 at xuppa.com
> Sent: 05 February 2003 20:16
> To: accessd at databaseadvisors.com
> Subject: RE: [AccessD] adding field to table via code
> 
> 
> Andy, Charlotte  was right i had to go to vb help not Access, 
> well  Isleep 5 hours a day (thats why i am going on vacation 
> :) I am gtting error in
> this line ---   .Fields.Append. CreateField("PriKey", dbAutonumber)
> 
> Dim dbDM As Database
>     Dim tbGAP As TableDef
>     Dim fldLoop As Field
>     Dim tdfNew
> 
>     Set dbDM = OpenDatabase("Daily MIS.mdb")
>     Set tbGAP = dbDM.CreateTableDef("NewTableDef")
> 
>     With tbGAP
>         .Fields.Append. CreateField("PriKey", dbAutonumber)
>     End With
> 
>     dbDM.TableDefs.Append tdfNew
> 
>     MsgBox "Properties of new Fields in " & tdfNew.Name
> 
> 
> 
> 
> > Don't know why Help's not helping. Try going via the 
> TableDef object, 
> > cos it's one of its methods. BTW what version of Access?
> >
> > Andy Lacey
> > http://www.minstersystems.co.uk
> >
> >
> >
> >> -----Original Message-----
> >> From: accessd-admin at databaseadvisors.com
> >> [mailto:accessd-admin at databaseadvisors.com] On Behalf Of 
> >> Oleg_123 at xuppa.com
> >> Sent: 05 February 2003 19:33
> >> To: accessd at databaseadvisors.com
> >> Subject: RE: [AccessD] adding field to table via code
> >>
> >>
> >> yeah, I made it :))
> >> If i type it in one word in help (like u did) i get no 
> results, if i 
> >> tpe 2 words it tels me how to add a field in design view 
> or datasheet 
> >> view (which I had basically known for the last couple of years :))
> >>
> >> ----------------------------------------------
> >>
> >> > Hi Oleg, you made it :-)
> >> >
> >> > Yep to your question. See the CreateField method in Help.
> >> Post again
> >> > if you want help.
> >> >
> >> > Andy Lacey
> >> > http://www.minstersystems.co.uk
> >> >
> >> >
> >> >
> >> >> -----Original Message-----
> >> >> From: accessd-admin at databaseadvisors.com
> >> >> [mailto:accessd-admin at databaseadvisors.com] On Behalf Of 
> >> >> Oleg_123 at xuppa.com
> >> >> Sent: 05 February 2003 15:34
> >> >> To: accessd at databaseadvisors.com
> >> >> Subject: [AccessD] adding field to table via code
> >> >>
> >> >>
> >> >> Hey, I have a query one of it's components is a table that
> >> I convert
> >> >> daily from an Excel file (which is being sent daily)In
> >> order for the
> >> >> query to operate that table must have an autonumber (since
> >> they are
> >> >> always in the same order)So every day I manually add that
> >> field with
> >> >> an autonumber, which takes less then 2 min. However I am
> >> going for a
> >> >> couple of weeks, and I don't want to confuse the person
> >> who's going
> >> >> to be doing to be running reports while i am gone; So my questin
> >> is, can I write a vba procedure on button click that would
> >> >> add that field
> >> >>
> >> >> oleg?
> >> >>
> >> >>
> >> >> -----------------------------------------
> >> >> Send a Xuppa Valentine to Your Sweetheart today!
> >> > http://www.xuppa.com/greet/
> >> >
> >> >
> >> > _______________________________________________
> >> > AccessD mailing list
> >> > AccessD at databaseadvisors.com 
> >> > http://databaseadvisors.com/mailman/listinfo/accessd
> >> > Website: http://www.databaseadvisors.com
> >> >
> >> >
> >> > _______________________________________________
> >> > AccessD mailing list
> >> > AccessD at databaseadvisors.com 
> >> > http://databaseadvisors.com/mailman/listinfo/accessd
> >> > Website: http://www.databaseadvisors.com
> >>
> >>
> >>
> >> -----------------------------------------
> >> Send a Xuppa Valentine to Your Sweetheart today!
> > http://www.xuppa.com/greet/
> >
> >
> > _______________________________________________
> > AccessD mailing list
> > AccessD at databaseadvisors.com 
> > http://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> >
> > _______________________________________________
> > AccessD mailing list
> > AccessD at databaseadvisors.com 
> > http://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> 
> 
> 
> -----------------------------------------
> Send a Xuppa Valentine to Your Sweetheart today! 
http://www.xuppa.com/greet/


_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com





More information about the AccessD mailing list