Solved

Compilation Error.  Method or Data Member not found on Command me.refreh

Posted on 2004-04-29
8
3,229 Views
Last Modified: 2007-12-19
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.[CompanyName], TBLCustomerAddress.[ContactName],"
ssql = ssql & " TBLCustomerAddress.[Address],"
ssql = ssql & " TBLCustomerAddress.[City], TBLCustomerAddress.[State], TBLCustomerAddress.[Postal Code], TBLCustomerAddress.[Country]"
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

0
Comment
Question by:TOPIO
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 11

Accepted Solution

by:
phileoca earned 80 total points
ID: 10952614
try me.requery or Docmd.requery

<>< kT
0
 
LVL 57
ID: 10952619
Check your references.  Make sure none are listed as missing or broken.  

 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.
0
 
LVL 57
ID: 10952640
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.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 10

Author Comment

by:TOPIO
ID: 10953085
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
0
 
LVL 10

Author Comment

by:TOPIO
ID: 10953125
However after creatingthe MDE the Database window still shows up.
0
 
LVL 57
ID: 10953126
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.
0
 
LVL 57
ID: 10953150
Note that a requery is not the same as a refresh You may not get the results you want.

Jim.
0
 
LVL 6

Expert Comment

by:JohnDesautels
ID: 14162972
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.
------------------
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question