Solved

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

Posted on 2004-04-29
8
3,228 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying 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

Suggested Solutions

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…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
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…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

789 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