A
AccessThis
I am stumped so hopefully someone can tell me why I am getting these results:
I am trying to size a form in Access 2000 from the VBA module for the form (the On Open event). I have tried 3 methods, which I believe should be equivalent, but which give different results. I am putting the actual lines of code I have tried in hard brackets [].
1) I build a macro (let's call it "macro1"). The only action in this macro is MoveSize ( , ,7.1,4.5) to make the form's dimensions 7.1"x4.5". In the VBA code I use the command [DoCmd.RunMacro "macro1"] and everything works as it should.
2) In the VBA code I replace the command above with [DoCmd.MoveSize , , 7.1, 4.5] and the form disappears when I open it. Why doesn't this have the same effect as 1)?
3) I use 2 commands to assign the width and height of my form. The VBA commands are [myform.Width=7.1] followed by [myform.Detail.Height=4.5]. This code does not seem to do anything. The window does not disappear as in 2) but it is not sized either.
I have also tried these different methods in the On Load event (instead of the On Open event) with the same results. The easy answer is to use method 1) but it very frustrating not being able to figure out what is wrong with 2) and 3). If someone can enlighten me I would appreciate it.
I am trying to size a form in Access 2000 from the VBA module for the form (the On Open event). I have tried 3 methods, which I believe should be equivalent, but which give different results. I am putting the actual lines of code I have tried in hard brackets [].
1) I build a macro (let's call it "macro1"). The only action in this macro is MoveSize ( , ,7.1,4.5) to make the form's dimensions 7.1"x4.5". In the VBA code I use the command [DoCmd.RunMacro "macro1"] and everything works as it should.
2) In the VBA code I replace the command above with [DoCmd.MoveSize , , 7.1, 4.5] and the form disappears when I open it. Why doesn't this have the same effect as 1)?
3) I use 2 commands to assign the width and height of my form. The VBA commands are [myform.Width=7.1] followed by [myform.Detail.Height=4.5]. This code does not seem to do anything. The window does not disappear as in 2) but it is not sized either.
I have also tried these different methods in the On Load event (instead of the On Open event) with the same results. The easy answer is to use method 1) but it very frustrating not being able to figure out what is wrong with 2) and 3). If someone can enlighten me I would appreciate it.