Solved

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

Posted on 2004-04-29
8
3,224 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
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
 
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

758 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now