Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2004-04-29
8
Medium Priority
?
3,233 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 320 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

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!

Question has a verified solution.

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

609 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