|
-
Mar 23rd, 2000, 11:52 PM
#1
Thread Starter
Lively Member
I am using an access database with my program, i emailed my program to a friend yesterday to see if it would run on his computer, like me he has the professional edition. The program ran fine on his computer, although the forms weren't centered due to the resolution. My problem was I put the program on a CD took it home and loaded it in my computer at home, which also has the professional edition and it wouldn't work. I got an error saying(sorry don't remember exact words)that it couldn't access the database, that it was read only, and that the the programmer set it's administrative settings that way and they would need to be changed. Any ideas why it worked on my friends computer, but not mine? And any ideas what to do about the settings? And while we at it, could someone go over once again the code to set the child forms to open centered in the MDI parent, regardless of resolution settings?
Thanks!
-
Mar 24th, 2000, 12:11 AM
#2
Fanatic Member
centering forms
Cady,
Not sure about all your access problems but i can help with the mdi problem.
when the child form loads put the following into the form load event
Me.Move (mdiForm1.Width - Me.Width) / 2, (mdiForm1.Height - Me.Height) / 2, Me.Width, Me.Height
Hope this solves at least your easier problem
Iain.
-
Mar 24th, 2000, 12:26 AM
#3
Fanatic Member
If you have a toolbar in your mdi form then the child form will not be centered vertically, try this :
Me.Left = mdiForm1.ScaleWidth - Me.Width) / 2
Me.Top = mdiForm1.ScaleHeight - Me.Height) / 2
Just a thought but have you checked the properties of the access db to see if it read only.
-
Mar 24th, 2000, 12:29 AM
#4
Fanatic Member
That should of course be with the ('s before the mdiForm1's.
-
Mar 24th, 2000, 02:35 AM
#5
Thread Starter
Lively Member
Thanks, I tried both of your codes and with both the form opened in the upper left hand corner, not all the way but pretty close. Anymore thoughts on this?
Stevie, this is a stupid question that I think I know the answer to but don't want to screw anything up, but how do I check if I have it set to read only?
Thanks again.
-
Mar 24th, 2000, 11:33 AM
#6
Hyperactive Member
Hi, Cady.
Setting Child Form Size and Position
When an MDI child form has a sizable border (BorderStyle = 2), Microsoft Windows determines its initial height, width, and position when it is loaded. The initial size and position of a child form with a sizable border depends on the size of the MDI form, not on the size of the child form at design time. When an MDI child form's border is not sizable (BorderStyle = 0, 1, or 3), it is loaded using its design-time Height and Width properties.
If you set AutoShowChildren to False, you can change the position of the MDI child after you load it, but before you make it visible.
Private Sub MDIForm_Load()
MDIForm1.AutoShowChildren = False
Form1.Move (MDIForm1.Width - Form1.Width) / 2, (MDIForm1.Height - Form1.Height) / 2, Form1.Width, Form1.Height
MDIForm1.AutoShowChildren = True
End Sub
Private Sub MDIForm_Resize()
Form1.Move (MDIForm1.Width - Form1.Width) / 2, (MDIForm1.Height - Form1.Height) / 2, Form1.Width, Form1.Height
End Sub
Larisa
-
Mar 25th, 2000, 01:56 AM
#7
Fanatic Member
Just right click on the mdb file from windows explorer, and the file attributes will be displayed. If the read only check box is ticked, just uncheck it to make it no longer read only.
Also I forgot to mention that for my code to work I had the border style of the child window set to fixed single.
Hope this helps.
-
Mar 26th, 2000, 09:42 AM
#8
Lively Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|