Member Panel


Sponsors and Ads

Live Tag Cloud

PC Forum PC Help Forum » Software » General Software » Need help with Visual basic and Access mdb

General Software - Need help with Visual basic and Access mdb posted in the Software forums; Hi All, I hope someone can help me with this I have a visual basic application that's linked to a acces mdb. what the problem is I have a form ...

JOIN US NOW to remove these Ads

Post New Thread  Reply
  #1  
Old 01-23-2007
madmatt2006's Avatar
PC Dinosaur
 
Join Date: Dec 2006
Location: Shepparton
Posts: 2,585
PC Experience: Elite PC Guru
madmatt2006 - See this Members User comments on their Profile page madmatt2006 - See this Members User comments on their Profile page madmatt2006 - See this Members User comments on their Profile page madmatt2006 - See this Members User comments on their Profile page madmatt2006 - See this Members User comments on their Profile page madmatt2006 - See this Members User comments on their Profile page madmatt2006 - See this Members User comments on their Profile page madmatt2006 - See this Members User comments on their Profile page madmatt2006 - See this Members User comments on their Profile page madmatt2006 - See this Members User comments on their Profile page madmatt2006 - See this Members User comments on their Profile page
Default Need help with Visual basic and Access mdb

Hi All, I hope someone can help me with this I have a visual basic application that's linked to a acces mdb. what the problem is I have a form called frmExtraText it has a text box for inputing data and storing it in the mdb called txtExtraText I have gone through my code and tried to debug it but it seems to be going through the code ok just not storing the data which is strange because it has worked before it just decided to stop working? I havn't made any changes to the coding. I have attached the coding and a picture of the form incase someone would like a look. If anyone needs more information to workout what's going on please let me know. I'm really stuck on this problem and need to get it working

Thanks.
Attached Files
File Type: txt AddNewRecord.txt (16.5 KB, 1 views)
File Type: txt Update.txt (16.5 KB, 1 views)
File Type: zip Picture of the form.zip (89.2 KB, 1 views)
File Type: txt ExtraText.txt (1.9 KB, 1 views)


__________________
  #2  
Old 01-23-2007
madmonkey's Avatar
Site Manager
My PC
 
Join Date: Oct 2006
Location: South Wales
Posts: 5,536
PC Experience: PC Basket Ball Head!
madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page
Default

Hey matt,

Is it just the information in this extra text box that is not saved, or the entire record?

There's only an exit button on that form. I take it theres a main form where the address, quote details and everything is entered? And then you have this extra text form which pops up for more information? Surely if you close this form, all the data in that text box will be lost?


__________________

Free Links: Hit Counter.. - ..Form Mail.. - ..Games.. - ..Amuz'd.. - ..Psychometrics Online.. - ..myFavorites Homepage
Submit your URL or Blog to: cyberJuice USA / UK online shopping links and blogs.
  #3  
Old 01-23-2007
madmatt2006's Avatar
PC Dinosaur
 
Join Date: Dec 2006
Location: Shepparton
Posts: 2,585
PC Experience: Elite PC Guru
madmatt2006 - See this Members User comments on their Profile page madmatt2006 - See this Members User comments on their Profile page madmatt2006 - See this Members User comments on their Profile page madmatt2006 - See this Members User comments on their Profile page madmatt2006 - See this Members User comments on their Profile page madmatt2006 - See this Members User comments on their Profile page madmatt2006 - See this Members User comments on their Profile page madmatt2006 - See this Members User comments on their Profile page madmatt2006 - See this Members User comments on their Profile page madmatt2006 - See this Members User comments on their Profile page madmatt2006 - See this Members User comments on their Profile page
Default

Hi madmonkey, Before we start I'm just letting you know I didn't build this application but I'm now responsible for maintaining it. Yes it is just the information in the extra text box that is not getting saved the rest of the record is fine and you are right it is a text box that opens from the main form. I tried a few thing to try workout what going on the first thing was I entered data in the mdb table and went back to the application to see if it appeared and it did I then closed the DB and reopend it and the data was still there when using the app but if I modified the data in the app it drops the data completely. The strange thing is when you look at the table it appears to have been working at some stage. I think it might be best to modify the code on the extra text form to save the data I've had a little expirience with VB but I'm not entirly sure on how to do it. Do you have any ideas?


__________________
  #4  
Old 01-24-2007
madmonkey's Avatar
Site Manager
My PC
 
Join Date: Oct 2006
Location: South Wales
Posts: 5,536
PC Experience: PC Basket Ball Head!
madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page
Default

OK matt, can you give me a screenshot and the code of the mainform?

Also, I'm assuming there is some sort of save button on the main form. Can you press this whilst the extra test form is still visible to see if the data saves?


__________________

Free Links: Hit Counter.. - ..Form Mail.. - ..Games.. - ..Amuz'd.. - ..Psychometrics Online.. - ..myFavorites Homepage
Submit your URL or Blog to: cyberJuice USA / UK online shopping links and blogs.
  #5  
Old 01-24-2007
madmatt2006's Avatar
PC Dinosaur
 
Join Date: Dec 2006
Location: Shepparton
Posts: 2,585
PC Experience: Elite PC Guru
madmatt2006 - See this Members User comments on their Profile page madmatt2006 - See this Members User comments on their Profile page madmatt2006 - See this Members User comments on their Profile page madmatt2006 - See this Members User comments on their Profile page madmatt2006 - See this Members User comments on their Profile page madmatt2006 - See this Members User comments on their Profile page madmatt2006 - See this Members User comments on their Profile page madmatt2006 - See this Members User comments on their Profile page madmatt2006 - See this Members User comments on their Profile page madmatt2006 - See this Members User comments on their Profile page madmatt2006 - See this Members User comments on their Profile page
Default

Hey madmonkey, I thought that might be the problem. if you leave the extra text form open it makes no difference. There is a form that open after you click exit on the main form asking to save the changes. When it runs the code to save the changes I just noticed it thinks the txtExtraText has no value? I have attached a picture of that and the main form and the save form. I'm not to good at coding but I think it might have somthing to do with this code below but I'm not sure what it is

Function GetFirstExtraTextString(OldString As String) As String
Dim TheLength As Long
TheLength = Len(OldString)
If TheLength > 255 Then
GetFirstExtraTextString = Left(OldString, 255)
Else
GetFirstExtraTextString = OldString
End If
End Function
Function GetSecondExtraTextString(OldString As String) As String
Dim TheLength As Long
TheLength = Len(OldString)
If TheLength > 255 Then
If TheLength > 510 Then
GetSecondExtraTextString = Mid(OldString, 256, 255)
Else
GetSecondExtraTextString = Right(OldString, TheLength - 255)
End If
Else
GetSecondExtraTextString = ""
End If
End Function
Function GetThirdExtraTextString(OldString As String) As String
Dim TheLength As Long
TheLength = Len(OldString)
If TheLength > 510 Then
If TheLength > 765 Then
GetThirdExtraTextString = Mid(OldString, 511, 255)
Else
GetThirdExtraTextString = Right(OldString, TheLength - 510)
End If
Else
GetThirdExtraTextString = ""
End If
End Function
Function GetFourthExtraTextString(OldString As String) As String
Dim TheLength As Long
TheLength = Len(OldString)
If TheLength > 765 Then
GetFourthExtraTextString = Right(OldString, TheLength - 765)
If TheLength > 1020 Then
GetFourthExtraTextString = Mid(OldString, 766, 255)
Else
GetFourthExtraTextString = Right(OldString, TheLength - 765)
End If
Else
GetFourthExtraTextString = ""
End If
End Function
Function GetFifthExtraTextString(OldString As String) As String
Dim TheLength As Long
TheLength = Len(OldString)
If TheLength > 1020 Then
GetFifthExtraTextString = Right(OldString, TheLength - 1020)
Else
GetFifthExtraTextString = ""
End If
End Function
Attached Images
File Type: jpg Do you want to save changes.jpg (86.4 KB, 3 views)
File Type: jpg =nothingsmall.jpg (77.8 KB, 3 views)
File Type: jpg Smallmainform.jpg (73.2 KB, 2 views)


__________________

Last edited by madmatt2006; 01-24-2007 at 04:41 AM.
  #6  
Old 01-24-2007
madmonkey's Avatar
Site Manager
My PC
 
Join Date: Oct 2006
Location: South Wales
Posts: 5,536
PC Experience: PC Basket Ball Head!
madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page
Default

matt,

I've had a look at the code. I can't see anything that stands out by I did notice one thing. Can you change the following lines for me:

!ExtraText = GetFirstExtraTextString(frmExtraText.txtExtraText)
!ExtraText1 = GetFirstExtraTextString(frmExtraText.txtExtraText)
!ExtraText2 = GetFirstExtraTextString(frmExtraText.txtExtraText)
!ExtraText3 = GetFirstExtraTextString(frmExtraText.txtExtraText)
!ExtraText4 = GetFirstExtraTextString(frmExtraText.txtExtraText)

to

!ExtraText = GetFirstExtraTextString(frmExtraText.txtExtraText.value)
!ExtraText1 = GetFirstExtraTextString(frmExtraText.txtExtraText.value)
!ExtraText2 = GetFirstExtraTextString(frmExtraText.txtExtraText.value)
!ExtraText3 = GetFirstExtraTextString(frmExtraText.txtExtraText.value)
!ExtraText4 = GetFirstExtraTextString(frmExtraText.txtExtraText.value)

It maybe nothing, but it's just the way I was braught up with coding, the frmExtraText.txtExtraText could be preceived as the whole text box object, instead of just the contents of the text box itself.


__________________

Free Links: Hit Counter.. - ..Form Mail.. - ..Games.. - ..Amuz'd.. - ..Psychometrics Online.. - ..myFavorites Homepage
Submit your URL or Blog to: cyberJuice USA / UK online shopping links and blogs.

Reply
New! Norton Internet Security 2008 – Download Now Click Here

Bookmarks

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
Trackbacks are Off
Pingbacks are Off
Refbacks are On


All times are GMT +1. The time now is 07:58 PM.
Powered by vBulletin
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC7
All Graphics & Content Copyright © 2004-2008 - PC Help Forum.com


Back to Top