Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 7th, 2005, 5:11 PM   #1
emdiesse
Programmer
 
Join Date: Jul 2004
Location: Hampshire
Posts: 56
Rep Power: 5 emdiesse is on a distinguished road
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 Sub

Option 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 Sub

Option 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 Sub

Option 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 Sub

Option 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 Sub

Option 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 Sub

Option 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 Sub



Please 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.
emdiesse is offline   Reply With Quote
Old Apr 7th, 2005, 6:47 PM   #2
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
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)
Rory is offline   Reply With Quote
Old Apr 8th, 2005, 2:30 AM   #3
Berto
Programming Guru
 
Join Date: Aug 2004
Posts: 1,022
Rep Power: 5 Berto is on a distinguished road
Send a message via AIM to Berto Send a message via MSN to Berto
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.
Berto is offline   Reply With Quote
Old Apr 21st, 2005, 1:16 AM   #4
Bharathi
Programmer
 
Join Date: Apr 2005
Posts: 32
Rep Power: 0 Bharathi is on a distinguished road
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
Bharathi is offline   Reply With Quote
Old Apr 21st, 2005, 12:05 PM   #5
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
Please stop digging up old posts!
Rory is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:30 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC