SCBWV 71 Junior Poster

Yes, use twipsperpixel... I recently found this changed on wide-screen flat panels, and if you don't adjust for it, some elements on your forms will look crappy.

SCBWV 71 Junior Poster

VB6 can use Access files in other versions. I do it all the time with Access 2000 and 2003. You just have to load the correct DAO version.

SCBWV 71 Junior Poster

Does anyone know how to get the Rich Text Box to save margin information in a file? The RTB seems to ignore all margins.

SCBWV 71 Junior Poster

What database version format are you using? What version of DAO are you using?

Also, if you're working strictly with strings, you should use the specific versions of Left$(), Mid$(), Right$(), Chr$(), ChrW$(), UCase$(), LCase$(), LTrim$(), RTrim$(), Trim$(), Space$(), String$(), Format$(), Hex$(), Oct$(), and Str$().

Otherwise, VB uses the Variant version, which is much slower.

SCBWV 71 Junior Poster

You need to use the SysInfo Control. It has properties for ACStatuse, BatteryFullTime, BatteryLifePercent, BatteryLifeTime, and BatteryStatus. It will also tell you when the power status changes, among many other things.

SCBWV 71 Junior Poster

Nevermind... I figured it out. Using SQL of the QueryDefs overwrites the original query in the database with the new one. This thread can be closed.

Set dbsAccess = DBEngine.Workspaces(0).OpenDatabase(dbFile$, False, False)
Set qd = dbsAccess.QueryDefs("Agency Query")
qd.SQL = "SELECT...
dbsAccess.Close
SCBWV 71 Junior Poster

If the database is on a LAN, you can use Access format quite easily... I do it all the time.

SCBWV 71 Junior Poster

Ok, I figured out how to add a field to an existing table with DAO

Set dbsAccess = DBEngine.Workspaces(0).OpenDatabase(dbFile$, False, False)
'Agencies is a table in the Access database
Set td = dbsAccess.TableDefs("Agencies")
'Address2 is the field to be added
Set fd = td.CreateField("Address2", dbText, 50)
td.Fields.Append fd
dbsAccess.Close

Now the question is, how do I add the new field "Address2" to existing queries in the database? The database contains a query call "Agency Query." I need to add Address2 to this query.

Thanks for any help.

SCBWV 71 Junior Poster

I have a VB6 application that uses DAO to read and write MS Access files. Since the program uses Access files exclusives, it was written in DAO instead of ADO. The recordsets within the program are based on queries in the database. I need to add a field to the table and query. I'm sure I can figure out testing for the existence of the field in. My question: How can I add a new field to the table AND query?

SCBWV 71 Junior Poster

I ran into this on a commercial application I sell. It seems some of the new screens, particularly wide screen flat panels, return a different TwipsPerPixel. I was able to work around the issue by comparing the design resolution with the screen resolution being used (Screen.Width / Screen.TwipsPerPixelX) and adjusting the controls proportionally.

I found that it didn't matter if the picture was ont he form or in a control. Both were effected, as were text boxes and label controls. Find a widescreen o use for testing and take a look at what it does to your program.

SCBWV 71 Junior Poster

Try mydb.requery as well

SCBWV 71 Junior Poster

Congrats, fellow West Virginian!

SCBWV 71 Junior Poster

I'm not exactly sure what you're trying to do, but if you need the dimensions of a picture, why not load it in an autosiing picture box and read the dimensions?

SCBWV 71 Junior Poster

Why not you Microsoft Visual Studio Installer? The intallation can be uninstalled through the Control Panel.

SCBWV 71 Junior Poster

Rich Text Boxes have two properties for text - .Text and .TextRTF. Are you using the right one?