Can I access the properties of a field in a table...

  • Thread starter Thread starter Patrick
  • Start date Start date
P

Patrick

HI!!!

I've create an SQL string to be executed via VBA, as
fallow:

Set dbs = CurrentDb
SQLstring = "ALTER TABLE GradeTable " _
& "ADD COLUMN [" & MemName & "] Bit "
dbs.Execute SQLstring

Up to here eveything is working greate. Put can I also
gain access to the 'Display Control' in the lookup of a
field have just create for example. Via VBA of course.

Can it be done.

For now, ma newly create column as a 'Yes/No' dataType and
its seams OK. But I also would like to change its looks to
the 'Check box' property..... Its working find the way it
is setup now, but out of curiosity, I want to no if I can
access the fields of any table in my Access database, and
VIA VBA coding...

Any help will be appriciated...

Patrick
 
Hi,
You can use ADOX to alter the schema of a table in VBA.
Microsoft has many articles on ADO and ADOX with VBA.
 
I'm not sure but I think that the distinction beetween a Yes/No type or a
Checkbox type is stored by Access in the extended properties for that field.
SQL-Server itself doesn't mind anything about that and use the same type of
field with the same stored values.

So, any SQL code modifying these extended properties might be able to do the
trick.

S. L.

SFAxess said:
Hi,
You can use ADOX to alter the schema of a table in VBA.
Microsoft has many articles on ADO and ADOX with VBA.
-----Original Message-----
HI!!!

I've create an SQL string to be executed via VBA, as
fallow:

Set dbs = CurrentDb
SQLstring = "ALTER TABLE GradeTable " _
& "ADD COLUMN [" & MemName & "] Bit "
dbs.Execute SQLstring

Up to here eveything is working greate. Put can I also
gain access to the 'Display Control' in the lookup of a
field have just create for example. Via VBA of course.

Can it be done.

For now, ma newly create column as a 'Yes/No' dataType and
its seams OK. But I also would like to change its looks to
the 'Check box' property..... Its working find the way it
is setup now, but out of curiosity, I want to no if I can
access the fields of any table in my Access database, and
VIA VBA coding...

Any help will be appriciated...

Patrick
.
 
Back
Top