problem linking vba modules in MS Access 2007

Posted by Ted on Stack Overflow See other posts from Stack Overflow or by Ted
Published on 2010-06-09T19:14:14Z Indexed on 2010/06/11 8:22 UTC
Read the original article Hit count: 208

Filed under:

I am upgrading a database system from Access 2000 db to Access 2007, which communicates with several chemistry measuring devices(pH meter, scale, etc) via an RS 232 serial port. The first db consists of several modules containing vba code that enables the communications with the ports, as well as supports the code behind the forms in the second db. The user, or lab tech, navigates through the forms in the second db to interact with the lab devices, and also to generate the reports which display the info. from the devices. The reports are also part of the second db. The code works in Access 2000, but once I convert it to 2007, the code in the second db cannot find the function calls in the first db that dictate the progression from screen to screen. I have tried importing the modules into the second db, and I have tried linking them, but it still doesn't work. The error message is #438: "Object doesn't support this property or method." Any suggestions would be greatly appreciated.

Here is the code for the first function that is not being called correctly:

Description:
' This routine is used to return to the calling form and close the active form.
'
' Input:
' strFormCalled     ---  the active form
' strCallingForm    ---  the form that called the active form
' blnUnhideOrOpen   ---  whether to open or just unhide form

Public Sub basReturnToCallingForm(ByVal strFormCalled As String, ByVal _ 
    strCallingForm As Variant, Optional blnUnhideOrOpen As Boolean = True)

On Error GoTo err_basReturnToCaliingForm

    If Not basIsBlankString(strCallingForm) And blnUnhideOrOpen Then
        DoCmd.OpenForm strCallingForm, acNormal
    Else
        Call basUnHideForm(strCallingForm)
    End If

Call basCloseForm(strFormCalled)

exit_basReturnToCaliingForm:
    Exit Sub
err_basReturnToCaliingForm:
    Err.Raise Err.Number, "basReturnToCaliingForm", Err.Description
End Sub

I will post the second function shortly, but I have to go to a meeting... The second funtion that isn't 'working' is a cmdStartClick that is supposed to be called when a user initializes a pump. However, within that function, it's also sticking on a line that is supposed to progress to the next form in the db. The other thing is that the code works in Access 2002, but not in Access 2007...

© Stack Overflow or respective owner

Related posts about ms-access-2007