Solved

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

Posted on 2004-04-29
8
3,230 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 58
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 58
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
Independent Software Vendors: 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 58
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 58
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

Technology Partners: 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!

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
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.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

724 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