•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 397,875 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,582 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser:
Views: 5547 | Replies: 6
![]() |
•
•
Join Date: Aug 2004
Posts: 9
Reputation:
Rep Power: 0
Solved Threads: 0
I am a summer intern who has been given a project in MS Access and has little knowledge of VBA - so I would be extremely grateful if you could help me.
I have a form called Customer Programs that saves the program description, brand and year. Each program is given a unique ID calle the Customer Program ID that the computer uses to later filter data. (in another form) The format of this id is "CP***", so they are "CP001", "CP002, "CP003" and so on. I need the computer to understand this format so that it continues when a new program is added.
If you know of a way that this is possible and could walk me through it I would really appreciate it. Thank you in advance.
I have a form called Customer Programs that saves the program description, brand and year. Each program is given a unique ID calle the Customer Program ID that the computer uses to later filter data. (in another form) The format of this id is "CP***", so they are "CP001", "CP002, "CP003" and so on. I need the computer to understand this format so that it continues when a new program is added.
If you know of a way that this is possible and could walk me through it I would really appreciate it. Thank you in advance.
•
•
Join Date: Jun 2004
Posts: 604
Reputation:
Rep Power: 6
Solved Threads: 6
hi everyone,
if you are using visual basic you can connect to the access database using access but it can be very tidysome but if you are using rapid then what you can do (if your database does not contain any pictures or images) is try not to use access but use rapid to generate a database and use rapistream it. You can then use rapid or vba to read the database.
I hope this helps you
Yours Sincerely
Richard West
if you are using visual basic you can connect to the access database using access but it can be very tidysome but if you are using rapid then what you can do (if your database does not contain any pictures or images) is try not to use access but use rapid to generate a database and use rapistream it. You can then use rapid or vba to read the database.
I hope this helps you
Yours Sincerely
Richard West
•
•
Join Date: Jul 2004
Location: Adelaide, Australia
Posts: 191
Reputation:
Rep Power: 5
Solved Threads: 1
•
•
•
•
Originally Posted by MSUMichelle
I am a summer intern who has been given a project in MS Access and has little knowledge of VBA - so I would be extremely grateful if you could help me.
I have a form called Customer Programs that saves the program description, brand and year. Each program is given a unique ID calle the Customer Program ID that the computer uses to later filter data. (in another form) The format of this id is "CP***", so they are "CP001", "CP002, "CP003" and so on. I need the computer to understand this format so that it continues when a new program is added.
If you know of a way that this is possible and could walk me through it I would really appreciate it. Thank you in advance.
Hi Michelle,
First of all take a look at my pretty poor ado tutorial here: http://www.timesheetsmts.com/adotutorial.htm . Then perhaps have a go at getting something working and if you can't get it going post your code here and we'll try to help further.
Mark
PS did what the previous poster said make sense to anyone? :rolleyes:
Mark Nemtsas
Time and Billing Software - Time Tracking Software - Roller Shutters - Roller Blinds -
Baby Books
Time and Billing Software - Time Tracking Software - Roller Shutters - Roller Blinds -
Baby Books
•
•
Join Date: Aug 2004
Posts: 9
Reputation:
Rep Power: 0
Solved Threads: 0
I didnt understand the previous post but I figured it was just over my head....
I actually figured out the CP problem with a grueling process...but it works! (there HAS to be an easier way to do so though!) I do have another question while we're at it though, on the same form there are currently 5 records. I have it set so that it does not allow deletions, edits, or additions. (this is because I dont want to user to try to do so here) When the user selects the "Add New Program" button it changes the record source to a temp. table. The first few lines of the code is...
Private Sub saveprog_Click()
On Error GoTo Err_saveprog_Click
Form.AllowAdditions = True
Dim CPnum, CP, checkzeros As String
....
And even though the first thing I am telling it to do is to allow additions, it gets an error when you try to do so. Any ideaS?
I actually figured out the CP problem with a grueling process...but it works! (there HAS to be an easier way to do so though!) I do have another question while we're at it though, on the same form there are currently 5 records. I have it set so that it does not allow deletions, edits, or additions. (this is because I dont want to user to try to do so here) When the user selects the "Add New Program" button it changes the record source to a temp. table. The first few lines of the code is...
Private Sub saveprog_Click()
On Error GoTo Err_saveprog_Click
Form.AllowAdditions = True
Dim CPnum, CP, checkzeros As String
....
And even though the first thing I am telling it to do is to allow additions, it gets an error when you try to do so. Any ideaS?
•
•
Join Date: Nov 2005
Location: Montreal, QC (Almost)
Posts: 130
Reputation:
Rep Power: 3
Solved Threads: 9
Hi Michelle and JackAssNo1,
First of all I want to thank you for not going the way of letting your users do everything in one form, it'a an approach that often leads to catastrophe.
Now for the problem. I don't know what the 'cure' is for your problem with Form.AllowAdditions = True since I have never used that technique through my years of programming Access. However, I might have a workaround for you.
What I would do is to create a specific form for adding records which contains all the necessary fields for the project. When the user clicks the "Add Program" button this form opens and lets the user enter the details. Once finished, the user would click a "Save" button which would save the new project, close the "Add" form AND update the list form.
This way you don't have to deal with one form doing everything and your users will not be confused trying to figure out whether they're in Add or Read Only mode.
Hope this helps
Yomet
First of all I want to thank you for not going the way of letting your users do everything in one form, it'a an approach that often leads to catastrophe.
Now for the problem. I don't know what the 'cure' is for your problem with Form.AllowAdditions = True since I have never used that technique through my years of programming Access. However, I might have a workaround for you.
What I would do is to create a specific form for adding records which contains all the necessary fields for the project. When the user clicks the "Add Program" button this form opens and lets the user enter the details. Once finished, the user would click a "Save" button which would save the new project, close the "Add" form AND update the list form.
This way you don't have to deal with one form doing everything and your users will not be confused trying to figure out whether they're in Add or Read Only mode.
Hope this helps
Yomet
•
•
Join Date: Apr 2005
Location: Milwaukee, WI
Posts: 156
Reputation:
Rep Power: 4
Solved Threads: 3
It sounds like what you are trying to do is autoincrement your program id when a new program is created. Is this correct?
Nobody believes the official spokesman, but everybody trusts an unidentified source.
-- Please do not PM me with questions about a thread. If you respond to a thread, then everyone can benefit.
-- Please do not PM me with questions about a thread. If you respond to a thread, then everyone can benefit.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Similar Threads
- MS Access vs. MySQL (MS Access and FileMaker Pro)
- VBA Help (Visual Basic 4 / 5 / 6)
- Access table data transfer to file (MS SQL)
- VBA - Excel - sheet,range lookup with variables (Visual Basic 4 / 5 / 6)
- Access AutoNumber Decrement (Visual Basic 4 / 5 / 6)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Controlling minmized programs? Is it possible?
- Next Thread: VB6 Access error Please Please Help !!!


Linear Mode