VB School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a VB Expert!

Join 308,429 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 3,240 people online right now. Registration is fast and FREE... Join Now!




issues with coding.. help..

 

issues with coding.. help..

tica0419

15 Oct, 2007 - 09:30 PM
Post #1

New D.I.C Head
*

Joined: 8 Oct, 2007
Posts: 28


My Contributions
hi! im working on a program for 2 months already.. it is working fine except for 4 issues.. i have posted 3 of them here already.. ive tried researching on the web for more information but it is too difficult for me to configure the codes myself, so i would like to get some guidance from professionals like you guys..

1st issue, im having a hard time linking various hyperlinks using label to various pdf files.. ive tried various codes already including the the code below.. it worked perfectly but the problem is that my database has more than 2000 records, all with various pdf files.. all these are located in another PC.. what i wanted to happen is that instead of putting all the path name one by one for example C:\file1.pdf, C:\file2.pdf, and so on, i would like VB to search the database based on the path that is on the label caption.. here's the code that i used..

CODE

Private Sub Command1_Click()
retval = ShellExecute(Form1.hwnd, "Open", "C:\TEST.pdf", 0&, 0&, 1)
End Sub


2nd issue, case insensite database search.. Psychocoder helped me with this one but unfortunately, it didnt work in my system.. though i didnt get any errors.. anyway, my database is linked to MSFlexGrid.. im using the code below and it works fine.. it's just that i would like the system to search all those records even if it is in the lower/upper case.. here's the code..

CODE


MSFlexGrid1.FillStyle = flexFillRepeat
MSFlexGrid1.Col = 0
MSFlexGrid1.Row = 0
MSFlexGrid1.ColSel = MSFlexGrid1.Cols - 1
MSFlexGrid1.RowSel = MSFlexGrid1.Rows - 1
MSFlexGrid1.CellFontBold = False

    MSFlexGrid1.FillStyle = flexFillSingle
    
    For i = 0 To MSFlexGrid1.Cols - 1
    For j = 1 To MSFlexGrid1.Rows - 1
        
    If InStr(MSFlexGrid1.TextMatrix(j, i), TEXTSEARCH.Text) > 0 And _
    UCase("textsearch.text") = UCase(MSFlexGrid1.TextMatrix(j, i)) Then
    MSFlexGrid1.Col = i
    MSFlexGrid1.Row = j
    MSFlexGrid1.CellFontBold = True
    MSFlexGrid1.CellBackColor = &H80FFFF
    TEXTSEARCH.SetFocus
    'Else
    'MsgBox "Record not found", vbInformation + vbOKOnly, "MEMOS"
    'TEXTSEARCH.Text = ""
    'TEXTSEARCH.SetFocus
    'Exit Sub
    End If
          
    Next j
    Next i

End Sub


3rd issue, in one project i have several data objects.. one of the databases has 3 topics.. 2 forms in the project is linked to this database.. one form has 3 combo boxes all linked to the 3 topics.. the other form has 3 list boxes all linked to the 3 topics as well.. i tried a sample project at first using the code below, and it worked just the way i want it to.. but when i applied it to my application, i keep on getting this error "invalid use of null" for the code "combo1.additem rum1!topic" or "listtopic.additem rsMyRS!topic".. here's the code..

CODE

Dim dbMyDB As Database
Dim rsMyRS As Recordset

Private Sub Form_Load()

Set dbMyDB = OpenDatabase("F:\KAITH DBASE\FILE MAINTENANCE\TABLEACCESS.mdb")
Set rsMyRS = dbMyDB.OpenRecordset("TOPICTABLE", dbOpenDynaset)
    If Not rsMyRS.EOF Then rsMyRS.MoveFirst
    Do While rsMyRS.BOF
        LISTTOPIC.AddItem rsMyRS!TOPIC
        rsMyRS.MoveNext
    Loop

Set dbMyDB = OpenDatabase("F:\KAITH DBASE\FILE MAINTENANCE\TABLEACCESS.mdb")
Set rsMyRS = dbMyDB.OpenRecordset("SIGNTABLE", dbOpenDynaset)
    If Not rsMyRS.EOF Then rsMyRS.MoveFirst
    Do While Not rsMyRS.EOF
        LISTSIGNATORY.AddItem rsMyRS!SIGNATORY
        rsMyRS.MoveNext
    Loop

Set dbMyDB = OpenDatabase("F:\KAITH DBASE\FILE MAINTENANCE\TABLEACCESS.mdb")
Set rsMyRS = dbMyDB.OpenRecordset("FOLDERTABLE", dbOpenDynaset)
    If Not rsMyRS.EOF Then rsMyRS.MoveFirst
    Do While Not rsMyRS.EOF
        LISTFOLDER.AddItem rsMyRS!FOLDER
        rsMyRS.MoveNext
    Loop

end sub


i used the same code for the other form with combo boxes.. i just changed rsMyRS to rum1 and dbMyDB to dum1, and listtopic to combo1, listfolder to combo2 and listsignatory to combo3..

4th issue, in another form is where the user can search the database linked to msflexgrid.. i used the same code as the one above with the case insensitive.. but what i would like to do is that all the records that matched the textsearch textbox would show in another flexgrid.. because with the code that i have, it would only highlight the records that matched and the user will have to scroll throughout the flexgrid to view the result.. i hope you guys can help me with all these issues and i hope that these codes would be helpful to others.. thanks for your time and to those who have will have or who already has shared their thoughts and ideas for my dilemma.. thanks again!


User is offlineProfile CardPM
+Quote Post



Fast ReplyReply to this topicStart new topic

Time is now: 11/24/09 01:57PM

Live VB Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month