![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Jul 2004
Location: Hampshire
Posts: 56
Rep Power: 5
![]() |
Need a bit of help understanding some codes.
Hello. I am useing access to make a database and i need a little bit of help to undestand the codes being used. I have added a few, please change them if they are wrong.
These are the codes. Could someone please help me by going through them and adding comments on each line (like this: 'comment (obviously, lol)) Option Compare Database
Private Sub Combo8_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[OrderID] = " & Str(Nz(Me![Combo8], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
Private Sub Form_Current()
SubjectsNumber.Requery 'requerys the list of origional subjects
End SubOption Compare Database
Private Sub Combo36_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[OrderID] = " & Str(Nz(Me![Combo36], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End SubOption Compare Database
Private Sub Combo41_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[OrderID] = " & Str(Nz(Me![Combo41], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End SubOption Compare Database
Private Sub cmbCustOrd_Click()
On Error GoTo Err_cmbCustOrd_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmCustomerOrder"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "frmMainMenu", acSaveNo 'Close Main Menu when a button is clicked
Exit_cmbCustOrd_Click:
Exit Sub
Err_cmbCustOrd_Click:
MsgBox Err.Description
Resume Exit_cmbCustOrd_Click
End Sub
Private Sub cmbCancOrd_Click()
On Error GoTo Err_cmbCancOrd_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmCancelAnOrder"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "frmMainMenu", acSaveNo 'Close Main Menu when a button is clicked
Exit_cmbCancOrd_Click:
Exit Sub
Err_cmbCancOrd_Click:
MsgBox Err.Description
Resume Exit_cmbCancOrd_Click
End Sub
Private Sub cmbAlloSubj_Click()
On Error GoTo Err_cmbAlloSubj_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmAllocateSubjects"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "frmMainMenu", acSaveNo 'Close Main Menu when a button is clicked
Exit_cmbAlloSubj_Click:
Exit Sub
Err_cmbAlloSubj_Click:
MsgBox Err.Description
Resume Exit_cmbAlloSubj_Click
End Sub
Private Sub cmbManual_Click()
On Error GoTo Err_cmbManual_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmManual"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "frmMainMenu", acSaveNo 'Close Main Menu when a button is clicked
Exit_cmbManual_Click:
Exit Sub
Err_cmbManual_Click:
MsgBox Err.Description
Resume Exit_cmbManual_Click
End Sub
Private Sub cmbDatabase_Click()
On Error GoTo Err_cmbDatabase_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmAbout"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "frmMainMenu", acSaveNo 'Close Main Menu when a button is clicked
Exit_cmbDatabase_Click:
Exit Sub
Err_cmbDatabase_Click:
MsgBox Err.Description
Resume Exit_cmbDatabase_Click
End Sub
Private Sub cmbNotPaid_Click()
On Error GoTo Err_cmbNotPaid_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmPaid"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "frmMainMenu", acSaveNo 'Close Main Menu when a button is clicked
Exit_cmbNotPaid_Click:
Exit Sub
Err_cmbNotPaid_Click:
MsgBox Err.Description
Resume Exit_cmbNotPaid_Click
End Sub
Private Sub cmbPaid_Click()
On Error GoTo Err_cmbPaid_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmPaid"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "frmMainMenu", acSaveNo 'Close Main Menu when a button is clicked
Exit_cmbPaid_Click:
Exit Sub
Err_cmbPaid_Click:
MsgBox Err.Description
Resume Exit_cmbPaid_Click
End SubOption Compare Database
Private Sub Combo32_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[OrderID] = " & Str(Nz(Me![Combo32], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End SubOption Compare Database
Private Sub Combo32_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[OrderID] = " & Str(Nz(Me![Combo32], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End SubOption Compare Database
Private Sub Form_BeforeInsert(Cancel As Integer)
If txtCount >= 5 Then
MsgBox "You can only order 5." 'The message to be displayed if customer trys to order >5
Cancel = True 'Cancels the new record event.
End If 'End the if statement
End SubPlease help. Thanks. It would be helpful if you could add comments for every line of code. Thank you. Last edited by emdiesse; Apr 7th, 2005 at 5:31 PM. |
|
|
|
|
|
#2 |
|
Expert Programmer
|
I'm not sure I understand what your question is. If you can be more specific on what the problem is / what you want to do we can help.
Thanks (Are you doing Terry's Turkeys? If not, sorry) |
|
|
|
|
|
#3 |
|
Programming Guru
![]() |
if you are using visual stuudio or soem for or microsoft compiler put the mouse over the function name hit F1 and read the help about it.
Seems odd that you want us to put comments looks like homework you dont understand and so therefore want commenting. |
|
|
|
|
|
#4 |
|
Programmer
Join Date: Apr 2005
Posts: 32
Rep Power: 0
![]() |
Need a bit of help understanding some codes.
Hi,
We will tackle one problem at a time. Mention where you want to start. Regards Bharathi Books for developing your own Accounting and Inventory Management Application. http://www.vkinfotek.com |
|
|
|
|
|
#5 |
|
Expert Programmer
|
Please stop digging up old posts!
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|