Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

quiz

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hello,

I never touch MS Access before, but I get quiz from my boss. Can anybody help me out? Thank you very much for your kind help.

Jeannie

The folowing are questions:

***************************

'Please describe, in plain English, what the following snippets of code are doing
'Please make presumptions based on the information provided

===========================================================
Public Function KeyF(keyCode As Integer, strFormName As String, Optional _
strSubformName As String = "", Optional strSubSubFormName As String = "") _
As Integer

Dim ctl As Control

If strSubformName <> &quot;&quot; Then
If strSubSubFormName <> &quot;&quot; Then
Set ctl = Forms(strFormName).Controls(strSubformName).Form.Controls(strSubSubFormName).Form.ActiveControl
Else
Set ctl = Forms(strFormName).Controls(strSubformName).Form.ActiveControl
End If
Else
Set ctl = Forms(strFormName).ActiveControl
End If


Select Case intKey
Case Is = 43 'ASCII PLUS CODE
If keyCode = 43 Then intKey = 0
ctl = ctl + 1
keyCode = 0
Case Is = 45 'ASCII MINUS CODE
If keyCode = 45 Then intKey = 0
ctl = ctl - 1
keyCode = 0

End Select

End Function


==============================================================
Function GetDte(CurrentDate)

If VarType(CurrentDate) <> 7 Then
GetDte = Null
Else
Select Case WeekDay(CurrentDate)
Case 1
GetDte = CurrentDate - 6
Case 2
GetDte = CurrentDate
Case 3 To 7
GetDte = CurrentDate - WeekDay(CurrentDate) + 2
End Select

End If

CurrentDate = Date

End Function

==================================================================

UPDATE stuMain INNER JOIN psyIRTbl ON stuMain.StudID = psyIRTbl.IRStudID SET psyIRTbl.Selector = -1
WHERE (((stuMain.StudID)=[forms]![stuMainF]![txtStudID]));


==================================================================
Public Function whatAmIDoing() As String
Dim i As Integer

Randomize

i = Int((10000 * Rnd) + 1)

whatAmIDoing= &quot;TMP&quot; & Format(i, &quot;000000&quot;)

End Function

==================================================================
Private Sub cmdProcess_Click()
Dim conn As ADODB.Connection
Dim rst As ADODB.Recordset
Dim blnReturn As Boolean
Dim strSql As String
Dim strMsg As String

Me.Refresh

strMsg = &quot;You are about to do something???&quot;


If MsgBox(strMsg, vbYesNo, &quot;!!!!!ATTENTION!!!!!&quot;) = vbYes Then

Set conn = CurrentProject.Connection

Set rst = New ADODB.Recordset

rst.Open Me.RecordSource, conn

Do Until rst.EOF = True

If rst!blnAccept = True Then

strSql = &quot;UPDATE tblSchedule &quot; & _
&quot;SET tblSchedule.resID=&quot; & rst!resID_New & _
&quot; WHERE tblSchedule.ndxSched=&quot; & rst!ndxSched

conn.Execute strSql

End If

rst.MoveNext
Loop


MsgBox &quot;What you did is complete.&quot;
DoCmd.Close
End If

End Sub
======================================================================

Public Function whatAmIDoing()

Dim D As Integer

For D = 1 To 7
Select Case D
Case 7
Me(&quot;d&quot; & D) = Forms!frmmain!txtStartOfWeek
Case 1
Me(&quot;d&quot; & D) = Forms!frmmain!txtStartOfWeek + 1
Case 2
Me(&quot;d&quot; & D) = Forms!frmmain!txtStartOfWeek + 2
Case 3
Me(&quot;d&quot; & D) = Forms!frmmain!txtStartOfWeek + 3
Case 4
Me(&quot;d&quot; & D) = Forms!frmmain!txtStartOfWeek + 4
Case 5
Me(&quot;d&quot; & D) = Forms!frmmain!txtStartOfWeek + 5
Case 6
Me(&quot;d&quot; & D) = Forms!frmmain!txtStartOfWeek + 6
End Select
Next D

End Function

=============================================================================
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top