Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
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  
Old July 6th, 2004, 03:56 AM
Asperation Asperation is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 72 Asperation User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 m 9 sec
Reputation Power: 5
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

Reply With Quote
  #2  
Old July 8th, 2004, 01:13 AM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 19 h 31 m 41 sec
Reputation Power: 180
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

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > visual basic in ms access database, help needed


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway