If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
disable datasheet view in form
Hi Access gurus:
I am using Access 2002. I have a popup form which I want to open only in datasheet view. In the properties list of the form, I have the following settings: Default View: datasheet Allow Form View: No Allow Datasheet View: Yes However, the form still opens in Form View! What do I have to do to enforce Datasheet View? |
#2
|
|||
|
|||
disable datasheet view in form
"John Milbury-Steen" wrote in message
Hi Access gurus: I am using Access 2002. I have a popup form which I want to open only in datasheet view. In the properties list of the form, I have the following settings: Default View: datasheet Allow Form View: No Allow Datasheet View: Yes However, the form still opens in Form View! What do I have to do to enforce Datasheet View? I'm guessing this only happens when you open the form with code, using DoCmd.OpenForm. Right? When you use DoCmd.OpenForm to open a form, as opposed to doing it via the Access user interface, you must specify that you want to open the form in anything other than form view; e.g., DoCmd.OpenForm "MyPopupForm", acFormDS -- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup) |
#3
|
|||
|
|||
disable datasheet view in form
I'm guessing this only happens when you open the form with code, using DoCmd.OpenForm. Right? I didn't write any code to open the form. I open the form via a button. |
#4
|
|||
|
|||
disable datasheet view in form
"John Milbury-Steen" wrote in message
I'm guessing this only happens when you open the form with code, using DoCmd.OpenForm. Right? I didn't write any code to open the form. I open the form via a button. The button is using either VBA code or a macro to open the form. Was the button created by the Command Button Wizard? If so, it will have code for its Click event that looks something like this: Private Sub Command0_Click() On Error GoTo Err_Command0_Click Dim stDocName As String Dim stLinkCriteria As String stDocName = "Form1" DoCmd.OpenForm stDocName, , , stLinkCriteria Exit_Command0_Click: Exit Sub Err_Command0_Click: MsgBox Err.Description Resume Exit_Command0_Click End Sub (where "Command0" is the name of the button, and "Form1" is the name of the form being opened). What you would need to do is edit this code and change this line: DoCmd.OpenForm stDocName, , , stLinkCriteria to this: DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria That should do it. Do you know how to get at the button's code to edit it? -- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup) |
Thread Tools | |
Display Modes | |
|
|