In Access XP I have a continuous bound form with 2 controls:
- txtRecordID bound to RecordID
- txtRecord bound to Record
Each of these controls has FontName=CourierNew and FontSize=10 so that each character has the same width
The record is actually made up of 10 columns. So I have 10 labels in the form header. I also have a settings table that contains the names of each of these labels as well as its width in characters. In the Form_Load event I dynamically assign the the Left and Width attributes of each label so that it properly defines the start and end postion of each column. The detail section height is twice the height to txtRecord. Just above the text box I dynamically position some vertical lines to further show the field separation.
My problem is that the positioning of the form header labels and vertical lines in the detail section is never quite right across the entire width of txtRecord. I've tried the following base assumptions without total success:
dim lngUnitWidth as long
lngUnitWidth = 1440 / 12 ' the form grid is 24 x 24 and each character seems be be about 2 grid lines wide
lngUnitWidth = me.txtRecord.Width / 90 ' the text box is full at 90 characters
Any suggestions to help me with this dynamic alignement of labels and vertical bars?