Hey Guys:
One of my friends needs some help in solving some IT problems listed below. Your response will greatly be appreciated.
_____________________________________________________________________
Directions: Type answers to test – all typing should come up in red font. If it does not, change any new text that you enter to red font. Save the file with your name in place of the word “Template” in the file name.
QUESTION #1:
You have a form open in the Design View and the form contains a Combo Box named APET. How would you create a Sub – Routine that would execute miscellaneous code after a user has selected one of the options in the Combo Box?
QUESTION #2:
Below is a section of code that updates one of the tables in our database after a user has made some changes to the information displayed on the form. A problem occurs since there is not always an existing record in the “T ANTS – Revision Dates” table and an error will occur when this code executes. Project number is the Primary Key for the table and CurrentUser.Filter returns a string that stores the Project Number that the user was currently viewing in the form. Insert code that will handle the situation where a record does not exist in the table.
If (ReadOnly) Then
DoCmd.Close
Else
[Project Number].Value = CurrentUser.Filter
Dim dbs As Database
Dim rst As Recordset
Set dbs = CurrentDb()
' #12242001MV
' The user has made an update so update the Revision Dates table.
Set rst = dbs.OpenRecordset("SELECT * FROM [T ANTS - Revision Dates] WHERE
[Project Number] = '" & CurrentUser.Filter & "';")
rst.Edit
rst![Revision Date] = Now()
rst![Logon ID] = CurrentUser.ID
rst.Update
rst.Close
dbs.Close
' #12232001MV
' Handle click to return to Main Menu.
DoCmd.Close
End If
QUESTION #3:
Below is a section of code that executes once the user has clicked on a Check Box in the form named “Identify Complete”. Once this check box has been clicked on the “Analyze” and “Analyze Complete” fields that were originally disabled need to be enabled and the “Identify Complete” check box needs to be disabled so the user may not click on it again. Insert code that will disable and enable the appropriate fields.
Private Sub Identify_Complete_Click()
On Error GoTo ErrCatch
'10182002 BW
'Once the Identify step of the Corrective Action has been marked complete
'make the next field and check box in the Corrective Action process available
'04102003 BW
'Disable the Identify fields once the step has been marked as complete
Exit_Routine:
Exit Sub
ErrCatch:
Call Error_Catch(Err.Number, Err.Description)
Resume Exit_Routine
End Sub
QUESTION #4:
Below is code that executes when a user clicks the next button on one of the forms. The intention is for the current form to close and for the “ANTS – Contact Information” form to open when the user clicks on this button. Insert code that will handle this process.
Private Sub Next_Click()
On Error GoTo Err_Next_Click
' #04232002MV
' Added functionality for users to click the Next button to progress through the various
'SORM data input forms in a linear way.
If (Not ReadOnly) Then
[Project Number].Value = CurrentUser.Filter
End If
Exit_Next_Click:
Exit Sub
Err_Next_Click:
Call Error_Catch(Err.Number, Err.Description)
Resume Exit_Next_Click
End Sub