DoCmd.OpenForm" results-alcohol",," [result_no] =" & DoCmd.Close acForm,results-alcohol = 2 DoCmd.Close acForm,药物结果 DoCmd.Close acForm,results-alcohol = 2 DoCmd.Close acForm,药物结果结束如果那么DoCmd.OpenForm药物结果,,,,[result_no] =" & CStr(mers。[res_no]),, acDialog mers.Edit 如果mers.Positive< 3和Pos(药物结果)然后mers.Positive = 1否则如果mers.Positive< 3然后是mers.Positive = 2 如果怀疑(药物结果)或(mers.Positive = 1)那么mers.mro = False Else mers.mro = True mers。更新 DoCmd.Close acForm,药物结果结束如果 结束选择 Me.Refresh results_cont: DoCmd.SetWarnings True:DoCmd.Hourglass False 退出Sub results_err:如果Err = 3260那么 MsgBox此数据目前已被锁定。按Enter键再试一次 DoEvents 恢复结束如果 msgdisp GoTo results_cont End Sub *** ********************************************** **** ********************************************** **** ** 到目前为止它在这条线上失败了。如果是IsNull(mers。[res_no])或mers。[res_no] = 0那么我不知道什么理解的是什么是方法。在97是res_no?我认为括号表示它是一个字段,但是数据库中没有该对象的名称。 我也知道它在这个上失败了行也是: resrs.date_reptrcv = date 什么是date_reptrcv 任何帮助将不胜感激。如果有人有一个实用工具或什么东西,有助于筛选这些代码,并提出改变建议,也很有帮助。 无论如何,这个团队一直都很好帮忙。任何帮助非常感谢。Hello Fellow New Group Folks,Here''s today''s problem. I was called in to help convert an Access 97database to Access 2000. 99% of all my Access Dev. work has occurredin 2000, so I know very little about 97, however, from everything Iread, it sounded like a conversion from 97 to 2000 should go smoothly.Boy was I wrong.Here''s what we got. There is a form, that lists a group of employees.There is a command button, that when pressed, is supposed to go out andsee if there are any "results" for this particular employee. If thereisn''t any results, it is supposed to prompt the user to see if they''dlike to add a result at that time. Works great in 97. Gives a methodnot found. I looked at the code, with no avail. Here is the code.************************************************* ************************************************** ********Private Sub Results_Click()On Error GoTo results_err Dim a, mers As Recordset, f As Form Dim mydb As Database, resrs As Recordset If Me.Dirty Then DoCmd.DoMenuItem 0, 0, 4 Select Case Me!stype Case 2: Set mers = Me.RecordsetClone mers.Bookmark = Me.Bookmark If IsNull(mers.[res_no]) Or mers.[res_no] = 0 Then a = MsgBox("There are no results yet for this appointment. Doyou wish to add some?", 36, "No results yet") If a = 6 Then Set mydb = CurrentDb Set resrs = mydb.OpenRecordset("result-alcohol") resrs.AddNew resrs.date_reptrcv = date mers.Edit mers.[res_no] = resrs.result_no mers.Update resrs.Update DoCmd.OpenForm "results-alcohol", , , "[result_no] = " &CStr(mers.[res_no]), , acDialog Me!Positive = alcres("results-alcohol") DoCmd.Close acForm, "results-alcohol" End If Else DoCmd.OpenForm "results-alcohol", , , "[result_no] = " &CStr(mers.[res_no]), , acDialog If Forms.[results-alcohol].cpos Then Me!Positive = 1 ElseMe!Positive = 2 DoCmd.Close acForm, "results-alcohol" End If Case 3: Set mers = Me.RecordsetClone mers.Bookmark = Me.Bookmark If IsNull(mers.[res_no]) Or mers.[res_no] = 0 Then a = MsgBox("There are no results yet for this appointment. Doyou wish to add some?", 36, "No results yet") If a = 6 Then Set mydb = CurrentDb Set resrs = mydb.OpenRecordset("result-drug") resrs.AddNew resrs.date_reptrcv = date mers.Edit mers.[res_no] = resrs.result_no mers.Update resrs.Update DoCmd.OpenForm "drug result", , , "[result_no] = " &CStr(mers.[res_no]), , acDialog mers.Edit If Pos("drug result") Then mers.Positive = 1 Else mers.Positive= 2 If susp("drug result") Or (mers.Positive = 1) Then mers.mro =False Else mers.mro = True mers.Update DoCmd.Close acForm, "drug result" End If Else DoCmd.OpenForm "drug result", , , "[result_no] = " &CStr(mers.[res_no]), , acDialog mers.Edit If mers.Positive < 3 And Pos("drug result") Then mers.Positive =1 Else If mers.Positive < 3 Then mers.Positive = 2 If susp("drug result") Or (mers.Positive = 1) Then mers.mro =False Else mers.mro = True mers.Update DoCmd.Close acForm, "drug result" End If End SelectMe.Refreshresults_cont: DoCmd.SetWarnings True: DoCmd.Hourglass False Exit Subresults_err: If Err = 3260 Then MsgBox "This data is currently locked out. Hit Enter to try again" DoEvents Resume End If msgdisp GoTo results_contEnd Sub************************************************* ************************************************** ******It fails on this line, so far. If IsNull(mers.[res_no]) Or mers.[res_no] = 0 ThenWhat I don''t understand is what "method" in 97 is res_no? I wasthinking that the brackets would indicate that it is a field, but thereis no object in the database with that name.I also know that it fails on this lines as well: resrs.date_reptrcv = dateand what is date_reptrcvAny help would be appreciated. If anyone has a utility or somethingthat helps sift thru this code and made recommendations for changes,that is helpful also.No matter what, this group has always been good to help out. Any helpis appreciated. 要检查的事项 - 任何遗失的参考资料? 确保将引用设置为DAO 3.6对象库。 如果这是一个完整的数据库,预计不会有未来的扩展,请删除对Active x的引用数据对象(ADO)。 如果有可能在数据库上进一步完成工作,请保留对ADO的引用,但将DAO 3.6 在参考列表中引用它。 (更高的优先级)。 您还应该特别将数据库中变暗的任何记录集限定为DAO.Recordset。这是因为 记录集是DAO和ADO对象库的成员。如果变量不合格,将使用具有 最高优先级的库。这可能是您遇到问题的原因。 您可以对当前项目执行查找/替换以替换As Recordset的所有实例。与作为DAO.Recordet。 Wayne Gillespie Gosford NSW Australia Things to check - Any missing references? Make sure a reference is set to the DAO 3.6 Object Library. If this is a completed database with no future expansions expected, remove the reference to Active x Data Objects (ADO). If it possible that there will be further work done on the database, leave the reference to ADO but put the DAO 3.6reference above it in the reference list. (higher priority).You should also then specifically qualify any recordsets dimmed in the database as DAO.Recordset. This is becauserecordsets are a member of both the DAO and ADO object libraries. If the variables aren''t qualified the library with thehighest priority will be used. This is the likely cause of yoour problems. You can do a Find/Replace on the current project to replace all instances of "As Recordset" with "As DAO.Recordet".Wayne GillespieGosford NSW Australia 这篇关于找不到方法,访问97/2000转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-28 19:42