Bill Patten
bill_patten at embarqmail.com
Fri Apr 1 16:03:15 CDT 2011
Hi David, A couple of suggestions that might help you determine if your Modal idea is in fact the problem. In form frm_002D_Company open event try setting focus to an enabled control, this should bring it to the front. Since you you have a parameter declared to pass the name of the calling form, perhaps you could add code to hide the calling form in the on load or on open event of frm_002D_Company and then un hide it on form close. HTH Bill -------------------------------------------------- From: "David McAfee" <davidmcafee at gmail.com> Sent: Friday, April 01, 2011 11:37 AM To: "Access Developers discussion and problem solving" <accessd at databaseadvisors.com> Subject: [AccessD] Weird issues with one user I've been struggling with this issue for the last couple of days and it is driving me nuts. The user didn't have problems until they were given a newer computer. The computer has Vista as the OS and Access2007. I have some forms that were originally created in Access 2000, and another created in (I believe Access 2003). Now that they have the new computer, when the user clicks on cmdLocationAdd (or Edit), Access seems to lock up. What I believe is happening is that the form 002D is opening up in modal mode, but not on top of the form that is calling it. I can't recreate it on my machine (also a Vista box with A2007). I checked our references and they both match: Visual Basic for Applications Microsoft Access 12.0 Object Library OLE Automation Microsoft ActiveX Data Objects 2.1 Library Microsoft DAO 3.6 Object Library Any ideas? Here are the related subs: The A2003 calls a form on an OnClick event: Private Sub cmdLocationAdd_Click() Dim strOpenArgs As String strOpenArgs = "1|" & Me.lstCompaniesFound.Column(0) & "|||" & Me.lstCompaniesFound.Column(1) 'Debug.Print strOpenArgs DoCmd.OpenForm "frm_002D_Company", , , , , acDialog, strOpenArgs 'frm_002D_Company's opening Args are: Mode | CompanyID or AddrID | Return Form | Return Field | CompanyName End Sub Private Sub cmdLocationEdit_Click() Dim strOpenArgs As String 'frm_002D_Company's opening Args are: Mode | AddrID | null | null | null | strOpenArgs = "2|" & Me.lstCompanyLocations.Column(1) & "|||" & Me.lstCompaniesFound.Column(1) '2 = Edit DoCmd.OpenForm "frm_002D_Company", , , , , acDialog, strOpenArgs Me.lstCompanyLocations.Requery End Sub Private Sub Form_Load() On Error GoTo Form_Load_Error 'Dim errNum As Double, errDesc As String, errLine As Integer If Not IsNull(Me.OpenArgs) Then Dim arrX As Variant arrX = Split(Me.OpenArgs, "|") intMode = arrX(0) Select Case intMode Case 1 'Add Mode Me.txtCompanyID = arrX(1) Me.txtCompanyName = Nz(arrX(4), "") Me.cmdOK.Caption = "Confirm Addition" Me.Caption = "New Address Entry" 'Hide listbox & cmd button as we don't have an AddressID yet Me.lstAddtionalInfo.Visible = False Me.cmdAddAddtionalInfo.Visible = False Me.cmdEditAddtionalInfo.Visible = False Me.cmdDelAddtionalInfo.Visible = False ' Show fields below, so we can write to the appropriate fields when we append this record Me.txtPhone.Visible = True Me.txtfax.Visible = True Me.txtemail.Visible = True Me.txtLocationName = Nz(Me.txtLocationName, "Main Office") Case 2 'Edit Mode Me.txtAddrID = arrX(1) Me.txtCompanyName = Nz(arrX(4), "") Me.cmdOK.Caption = "Confirm Edit" Me.Caption = "Company Address Edit" 'Show listbox & cmd button as we now have an AddressID Me.lstAddtionalInfo.Visible = True Me.cmdAddAddtionalInfo.Visible = True Me.cmdEditAddtionalInfo.Visible = True Me.cmdDelAddtionalInfo.Visible = True 'No need to show these fields as we have the listbox available Me.txtPhone.Visible = False Me.txtfax.Visible = False Me.txtemail.Visible = False FillAddress (Me.txtAddrID) 'Fill Phone/fax/email info: Me.lstAddtionalInfo.RowSource = "EXEC stp_002DFillCompanyInfo " & Me.txtAddrID Case Else 'Trap code removed End Select strReturnForm = arrX(2) 'Parameter 3, the form that we will return the data to strReturnField = arrX(3) 'Parameter 4, the field in the above form that data will return to Else 'Do stuff when opened without OpenArgs End If End Sub -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com