?
Solved

SETTING ACCESS FIELD PROPERTIES FROM VB

Posted on 1998-10-08
6
Medium Priority
?
193 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
Independent Software Vendors: 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!

 

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

764 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