|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
|
|
#1
|
|||
|
|||
|
visual basic in ms access database, help needed
Code works to a certain extent, the pictures are displayed in the record, however, the same photos are displayed in all the records, even when u change it
![]() heres my code, can anyone help? Option Compare Database Option Explicit Private Sub Command104_Click() On Error GoTo ErrCommonDialog1 GetFileInformation (Find_File(glInitDir)) Me!txtPicture2 = glFileName Me!txtPathToHyperlink2 = "#" & glPath & "\" & glFileName ErrCommonDialog1: End Sub Private Sub Command110_Click() On Error GoTo ErrCommonDialog1 GetFileInformation (Find_File(glInitDir)) Me!txtPicture3 = glFileName Me!txtPathToHyperlink3 = "#" & glPath & "\" & glFileName ErrCommonDialog1: End Sub Private Sub Command29_Click() On Error GoTo ErrCommonDialog1 GetFileInformation (Find_File(glInitDir)) Me!txtPicture = glFileName Me!txtPathToHyperlink = "#" & glPath & "\" & glFileName ErrCommonDialog1: End Sub Private Sub Command98_Click() On Error GoTo ErrCommonDialog1 GetFileInformation (Find_File(glInitDir)) Me!txtPicture1 = glFileName Me!txtPathToHyperlink1 = "#" & glPath & "\" & glFileName ErrCommonDialog1: End Sub Private Sub Form_Current() On Error GoTo err_Form_Current If Not Me!txtPicture = "" Or Not IsNull(Me!txtPicture) Then Me!Picture.Picture = GetPathPart & Me!txtPicture Else If Not Me!txtPicture1 = "" Or Not IsNull(Me!txtPicture1) Then Me!Picture1.Picture = GetPathPart & Me!txtPicture1 Else If Not Me!txtPicture2 = "" Or Not IsNull(Me!txtPicture2) Then Me!Picture2.Picture = GetPathPart & Me!txtPicture2 Else If Not Me!txtPicture3 = "" Or Not IsNull(Me!txtPicture3) Then Me!Picture3.Picture = GetPathPart & Me!txtPicture3 Else Me!Picture.Picture = "" End If exit_Form_Current: Exit Sub err_Form_Current: MsgBox Err.Description Resume exit_Form_Current End Sub Private Sub Form_Open(Cancel As Integer) On Error GoTo Err_Form_Open If IsNull(Me!txtPicture) Or Me!txtPicture = "" Then ' do nothing Else Me!Picture.Picture = GetPathPart & Me!txtPicture End If If IsNull(Me!txtPicture1) Or Me!txtPicture1 = "" Then ' do nothing Else Me!Picture1.Picture = GetPathPart & Me!txtPicture1 End If If IsNull(Me!txtPicture2) Or Me!txtPicture2 = "" Then ' do nothing Else Me!Picture2.Picture = GetPathPart & Me!txtPicture2 End If If IsNull(Me!txtPicture3) Or Me!txtPicture3 = "" Then ' do nothing Else Me!Picture3.Picture = GetPathPart & Me!txtPicture3 End If Exit_Form_Open: Exit Sub Err_Form_Open: MsgBox Err.Description Resume Exit_Form_Open End Sub Private Function GetPathPart() As String ' Comments : Returns the path part of a string ' Parameters: strPath - string to parse ' Returns : path part ' Dim db As DAO.Database Dim strPath As String Dim intCounter As Integer Set db = CurrentDb strPath = db.Name db.Close Set db = Nothing For intCounter = Len(strPath) To 1 Step -1 If Mid$(strPath, intCounter, 1) = "\" Then Exit For End If Next intCounter GetPathPart = Left$(strPath, intCounter) End Function |
|
#2
|
|||
|
|||
|
Have you stepped through the code with the debugger?
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > visual basic in ms access database, help needed |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|