My Assistant
![]() ![]() |
|
|
Apr 27 2012, 03:24 PM
Post
#1
|
|
|
UtterAccess Veteran Posts: 453 |
Another silly question from a beginner..... I am trying to learn my way through vba code, and I thought that form names went in brackets in vba code. Such as DoCmd.OpenForm [OrderDetails]. But now I am seeing it written as : DoCmd.OpenForm "OrderDetails". I thought quotes were only for telling Access where actual text should begin and end. Did I miss a Chapter or is this a misprint?
Sorry for asking such a simple question...but my notebook is full and I don't see anything about quotes other than for text. THANKS!! Kathy |
|
|
|
Apr 27 2012, 03:29 PM
Post
#2
|
|
|
UtterAccess VIP Posts: 17,804 From: Don Mills, ON (Canada) |
From the Help file (on the DoCmd.OpenForm Method), the FormName parameter is "A string expression that's the valid name of a form".
In other words, you have to provide a string containing the name. It's either the name of the form in quotes: CODE DoCmd.OpenForm "OrderDetails" or a string variable: CODE Dim strForm As String strForm = "OrderDetails" DoCmd.OpenForm strForm |
|
|
|
Apr 27 2012, 03:47 PM
Post
#3
|
|
|
UtterAccess Veteran Posts: 453 |
Ok.
Doug, thanks for the explanation. Adding it to the notebook (IMG:style_emoticons/default/smile.gif) Kathy |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 19th June 2013 - 09:10 PM |