Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SETTING ACCESS FIELD PROPERTIES FROM VB

Posted on 1998-10-08
6
Medium Priority
?
194 Views
Last Modified: 2013-12-25
I've to create two new fields in an existing table of an existing Access Database from VB5. I used "createfield and append" to the table and it was all ok. But the problem is to set the Access properties that are not the same of DAO. For example i am not able to set the ACCESS FORMAT FIELD Property: I want to see "TRUE/FALSE" in the database record instead of seeing "0/-1" without stting it from Access. How can I do this ? How can I append a new Access property to DAO ? Thanks.
0
Comment
Question by:cmorok
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 

Author Comment

by:cmorok
ID: 1496777
Edited text of question
0
 
LVL 3

Accepted Solution

by:
vmano earned 200 total points
ID: 1496778
Dim DB As Database
Dim TD As TableDef
   
   Set DB = OpenDatabase("C:\Manohar\ExPRSDB\ECMV1_1.mdb")
   Set TD = DB.CreateTableDef("NewTableDef")
'Create and append new Field objects for the new TableDef object.
   With TD      
      .Fields.Append .CreateField("Boolean", dbBoolean)
      .Fields.Append .CreateField("IntegerField", dbInteger)
      .Fields.Append .CreateField("DateField", dbDate)
    End With
   DB.TableDefs.Append TD
   DB.Close
   MsgBox "Fields appended"

The Boolean type will set the Yes/No values in the field which are equivalent to True/False.

let me know if this helps,
vmano
0
 

Author Comment

by:cmorok
ID: 1496779
The problem is that if you open the database from Access you find  the field  fill from "0/-1"  and not True/false or Yes/No: how can I set the "format" property of Access that show the type of visualisation of the field ? Thanks for your   interest
Carlo.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:cmorok
ID: 1496780
The problem is that if you open the database from Access you find  the field  fill from "0/-1"  and not True/false or Yes/No: how can I set the "format" property of Access that show the type of visualisation of the field ? Thanks for your   interest
Carlo.
0
 
LVL 3

Expert Comment

by:vmano
ID: 1496781
when you create the field with dbBoolean as the option, it will be Yes/No in the design mode and when you open the table it will be a checkbox. i don't see any 0/1 in the table.
and as far as i know, you can not format a field while creating or after creation from your VB code, but you can always format the data which is being retrieved from the table.

0
 

Expert Comment

by:dreamingeagle
ID: 1496782
I'm new to VB programming, but I also tried to change the Format property in the Access design mode, hoping it would carry over into VB.  But I think it only applies to how the data is displayed in Access.  When you see the Boolean field in a VB data grid, for instance, it will be 0/-1.  I think you have to do all the formatting from VB.

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question