TOPIO
asked on
Compilation Error. Method or Data Member not found on Command me.refreh
I have a form that updates the info whenever the user selects info from a combo box
the program works correctly.
However in order to make an MDE I read to decompile and compile my project.
The decompilation worked and the project still works.
However when I try to recompile I get the following error
"Compile Error: Method or Data Member Not Found"
as you can see from the code I'm Using DAO
********BEGIN CODE**************
Private Sub Combo126_AfterUpdate()
On Error GoTo Err_Combo126_AfterUpdate
Dim ssql As String
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim i As Integer
ssql = "SELECT TBLCustomerAddress.[Compan yName], TBLCustomerAddress.[Contac tName],"
ssql = ssql & " TBLCustomerAddress.[Addres s],"
ssql = ssql & " TBLCustomerAddress.[City], TBLCustomerAddress.[State] , TBLCustomerAddress.[Postal Code], TBLCustomerAddress.[Countr y]"
ssql = ssql & " FROM TBLCustomerAddress WHERE CustomerAddressID=" & Me.Combo126 & ";"
MsgBox (ssql)
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset(ssql)
'ssql = ""
'For i = 0 To 6
'ssql = ssql & " El Campo " & i & " es " & rst(i)
'Next
'MsgBox (ssql)
Me!FromCompany = rst(0)
Me!FromPerson = rst(1)
Me!FromAddress = rst(2)
Me!FromCity = rst(3)
Me!FromState = rst(4)
Me!FromPostalCode = rst(5)
Me!FromCountry = rst(6)
Me.Refresh '<============ THIS IS WHERE I GET THE ERROR
Exit_Combo126_AfterUpdate:
Exit Sub
Err_Combo126_AfterUpdate:
MsgBox Err.Description
Resume Exit_Combo126_AfterUpdate
End Sub
the program works correctly.
However in order to make an MDE I read to decompile and compile my project.
The decompilation worked and the project still works.
However when I try to recompile I get the following error
"Compile Error: Method or Data Member Not Found"
as you can see from the code I'm Using DAO
********BEGIN CODE**************
Private Sub Combo126_AfterUpdate()
On Error GoTo Err_Combo126_AfterUpdate
Dim ssql As String
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim i As Integer
ssql = "SELECT TBLCustomerAddress.[Compan
ssql = ssql & " TBLCustomerAddress.[Addres
ssql = ssql & " TBLCustomerAddress.[City],
ssql = ssql & " FROM TBLCustomerAddress WHERE CustomerAddressID=" & Me.Combo126 & ";"
MsgBox (ssql)
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset(ssql)
'ssql = ""
'For i = 0 To 6
'ssql = ssql & " El Campo " & i & " es " & rst(i)
'Next
'MsgBox (ssql)
Me!FromCompany = rst(0)
Me!FromPerson = rst(1)
Me!FromAddress = rst(2)
Me!FromCity = rst(3)
Me!FromState = rst(4)
Me!FromPostalCode = rst(5)
Me!FromCountry = rst(6)
Me.Refresh '<============ THIS IS WHERE I GET THE ERROR
Exit_Combo126_AfterUpdate:
Exit Sub
Err_Combo126_AfterUpdate:
MsgBox Err.Description
Resume Exit_Combo126_AfterUpdate
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Also, you may be hitting the VBE6.DLL bug. Make sure your on SP3. See the following MSKB article for more details:
ACC2000: Error Message: Error Accessing File. Network Connection May Have Been Lost.
http://support.microsoft.com/default.aspx?scid=kb;EN-US;304548
Jim.
ACC2000: Error Message: Error Accessing File. Network Connection May Have Been Lost.
http://support.microsoft.com/default.aspx?scid=kb;EN-US;304548
Jim.
ASKER
I'm on SP3 and the reason I'm being forced to do the decompile is because I'm trying to create an MDE and the system kept giving me an error on that regard.
When I write me the automatic list that appears after entering me.
does not show refresh or requery
docmd.requery works
When I write me the automatic list that appears after entering me.
does not show refresh or requery
docmd.requery works
ASKER
However after creatingthe MDE the Database window still shows up.
Open a module in design view, click tools/references. Check for any that are listed as MISSING or BROKEN. If so, you'll need to figure out why (ie. DAO may have become unregistered).
If not:
1. check any unchecked reference.
2. Close the database and Access.
3. Reopen and uncheck the reference just checked
4. Compile.
Does it work?
If not, chances are that DAO is not registered properly. Let me know if you get to this point.
Jim.
If not:
1. check any unchecked reference.
2. Close the database and Access.
3. Reopen and uncheck the reference just checked
4. Compile.
Does it work?
If not, chances are that DAO is not registered properly. Let me know if you get to this point.
Jim.
Note that a requery is not the same as a refresh You may not get the results you want.
Jim.
Jim.
Jim,
Just wanted to let you know that your solution worked for me.
Thanks!
John
------------------
1. check any unchecked reference.
2. Close the database and Access.
3. Reopen and uncheck the reference just checked
4. Compile.
------------------
Just wanted to let you know that your solution worked for me.
Thanks!
John
------------------
1. check any unchecked reference.
2. Close the database and Access.
3. Reopen and uncheck the reference just checked
4. Compile.
------------------
I also would not use /decompile as a routine type of thing, but only if your having a problem. It never was intended for general use.
You can also try:
1. Save the module as text
2. Delete the module
3. If this is in a form or report, mark it's has module as no
4. close and exit
5. Open and read in the text file.
Then try a compile.
Jim.