Google
 
Webnews.only-4-geeks.com
Interesting places
news.only-4-geeks.com Forum Index » Access

Command Button

 
Jump to:  
 
Pass-the-reality
PostPosted: Fri Sep 12, 2008 11:37 am    Post subject: Command Button
       
On my form (frmlookuprecords) I have only one field (text1) which captures
the associates CSR (user id #). I added a Command button to
frmlookuprecords using the wizard. The Command button is linked to
frmMainForm. Within the Wizard I linked text 1 on frmlookuprecords to CSR on
frmMainForm. This feature allows me to click on the Command button and only
pull up my personal records (based on my CSR).
I want to take the code one step further. On the form frmMainForm, there is
a subform that contains a field called Order By. When I click the Command
Button, I want it to only show my records (like it is doing now) and also
only show the records where the Order By is null. The break down of this
field is [frmMainForm]![frmOMSOrderBy]![Order By]. What do I need to add to
the code below?

Private Sub Command7_Click()
On Error GoTo Err_Command7_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmMainForm"

stLinkCriteria = "[CSR]=" & "'" & Me![Text1] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command7_Click:
Exit Sub

Err_Command7_Click:
MsgBox Err.Description
Resume Exit_Command7_Click

End Sub
 

Page 1 of 1 .:.

Google
 
Webnews.only-4-geeks.com

Windows Update | C++ | C | PHP | JavaScript | Photoshop | Programming | Windows 2000 | Python | Windows XP | Object | Flash | Flash - ActionScript | Paint Shop Pro | Excel | PowerPoint | Access | Word | Windows 98 | Internet Explorer 6.0 | CorelDraw12 | Java | XML | asm x86 | Linux Mandrake | Linux RedHat | Outlook |  | news from newsgroups |_ | s

Web Templates

Awesome Website Templates ©

Deszczownica do łazienki bramy garażowe Są pewne sprawy - Grzegorz Turnau carports Linki zakładki