can any one show me how i can display display field types of access tables in a text box using vba? I have no idea how i can obtain that information using vba. Looking forward to your replys.Thanks
Printable View
can any one show me how i can display display field types of access tables in a text box using vba? I have no idea how i can obtain that information using vba. Looking forward to your replys.Thanks
Depending on whether you are using ADO or DAO its slightly different. For ADO you need to look at ADOX.
General principle is to get a variable as the object and loop through its properties/methods ;)
example
There are tutorials online for this, so perhaps a search on yahoo or google may produce helpful hints?Code:rs.fields.count '<-- recordset object, fields, count being the number of them
rs.fields(0).name '<-- the name of field at 0 (might be position 1 for start - you experiment and post up ;) )
www.vbworld.com used to have examples, whether they do now I dunno... but there are other places...uhmm www.w3schools.com
Thank u for u reply . I be happy if u show me the complete sub since i am very new to ado. What actually i am trying to do is generate a new create table statments and write it to a file.So my first step is to learn how to display all the fields type!Quote:
Originally Posted by Ecniv
Are you knowledgable in VB/VBA ??
If not, then you definitely need to start with some tutorials on ADO VBA/VB. Any code I post won't mean much.
Tell you what. Read up and try a tutorial or two (you find them) then make a new program/mdb and try on your own. As soon as you have some code (even if it doesn't work) post that up and perhaps we can assist in correcting the mistakes?
Are you doing this for work or for an assignment (college/uni)?
Well i want learn this for my future job hunting. so i started to learn meta data vba programing and i can not fine a good book or article for it!Quote:
Originally Posted by Ecniv
Tony,
perhaps you should take the advice, and buy yourself a book.
and perhaps, keep all of your posts in a single thread instead of posting several random questions about things you obviously have no understanding of at all. this is called spamming on most forums
make an effort to learn what you want first, then assistance would be easier to come by.
and what do you mean by meta data vb programming?
meta tag programming for example is HTML
VB is not the same thing.
perhaps i am misunderstanding what you mean.
Brian: just found this - might be what Tony wants to (sort of) do Here
Tony:
If the above link is what you are thinking of doing, you do really need a base to start from.
As you say you are looking at this as a prospective job role (I haven't heard of it until now) you may want to rethink a bit :D
Have you actually seen roles for this type of job anywhere?
How much experience are they asking for?
If you want Office VBA (Access/Excel) for manipulating data, these forums can help, but you really need a goal or project to use. Mainly because tutorials (although useful in giving ideas) tend not to be realistic in the long term.
If you are in a job at the moment, and want to do VBA things, see what you can find for mini projects.
Excel VBA is mainly used for repetative tasks, that you can get the comp to do for you. Access VBA is up to you. I prefer VBA (personal preference) to using the bound forms, but I've done Access Dbs for ages. I've also found that my experience of VBA Access helped with Excel.
Main point being, if you want to learn it to assist job hunting, then start with a tutorial, then move to office useful stuff. Mainly because people give you feedback on your macros in the office (bad/good/excellent/timesaver/accurate/moneysaver).
Have I waffled too much?? ;)