Hello.
I'm very new to access database and I'm trying to create a macro that allows the user to enter data after seeing a mistake in a form. I need a macro that will open the specific table and record of a piece of data. For example there is a student TestName3 whose grade on a competency is 30% but should really be 45%. I want a macro by the competency percentage to allow the teacher to edit that without looking through the entire table. The macro should prompt first to ask if the teacher is sure they would like to edit, second prompt asking for the student's unique ID number, and finally be taken to the specific record and table related to that competency.
In my infinite stupidity I have tried to use a vastly overcomplicated DLookup and Order column to give me the value for a acGoTo search.
Here's what I have.
Option Compare Database
'------------------------------------------------------------
' Command71_Click
'
'------------------------------------------------------------
Dim answer As String
Dim response As Object
Dim gotoresponse As Object
Private Sub Command71_Click()
On Error GoTo Command71_Click_Err
If MsgBox("Are you sure you want to edit this Competency?", vbYesNo, "Selection") = vbNo Then Exit Sub
response = InputBox("What is the student's UFID", "Student UFID", acFirst)
DLookup("[Order]", "Competency", "[UFID]=" & response) = response
gotoresponse = CInt(response)
DoCmd.OpenTable "Competency", acViewNormal, acEdit
DoCmd.GoToRecord acDataTable, "Competency", acGoTo, gotoresponse
Command71_Click_Exit:
Exit Sub
Command71_Click_Err:
MsgBox Error$
Resume Command71_Click_Exit
End Sub
Please help!!!