Access 2010 Form - Navigate to specific record & add new custom ID

Posted on 2014-02-08
Last Modified: 2016-05-15

I have an access database attached below and I want to be able to add new records and edit existing records. I have a form called frm_projects. On this form, I have a add project button and lookup project button. I need to have custom tracking IDs. For example I have multiple "categories" such as east, west, south, etc.. I need to be able to store a custom tracking ID such as EST01, if east is selected. The next record would then be EST02 if a new one was added.

Could someone give me some guidance on how to go about doing this?

Also, I need to figure out how to link the Project Information to the Savings Information.

Any help would be greatly appreciated!
Question by:tawathav
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 16

Expert Comment

ID: 39844886
I can't download your db so can't see the table structure. But I'd suggest that you simply use the records ID and the category for tracking.

You will need a table category with fields: category ID;Category

In your project record you would have a catergory field that looks up to the category table.

So if you run a query where recordID=X and Catergory=East you should be able to track the record
LVL 10

Expert Comment

ID: 39846402
I would suggest you to use the category ID and not the values, and rather to split to 3 tables tblCategory, tblSubcategory, tblTertiaryCategory.

And to answer you first question
You should add new field in tbl_projects CustomID, and by Form_BeforeUpdate event you should write
   Dim MaxID As Long
   MaxID = Nz(DMax("Right(CustomID,3)", "tbl_projects", "Category='" & Me.CategoryCombo & "'"), 0)
   If IsNull(Me.CustomID) Then
      Me.CustomID = DLookup("Abbreviation", "tbl_categories", "Category='" & Me.CategoryCombo & "'") & Format(MaxID + 1, "000")
   End If

Open in new window


Author Comment

ID: 39848049
I can't get this to work. Any other suggestions? Can you show me an example?
Increase your protection from Zero Day threats!

Running two Antivirus' is never a good idea.
Taking advantage of Multiple Security layers on the other hand can often save your hide.
See which top notch security software brands have been proven to happily coexist together.
Reduce your chances of becoming a statistic.

LVL 10

Accepted Solution

Gozreh earned 500 total points
ID: 39848083

Author Comment

ID: 39848153
Thank you Gozreh! Exactly what I wanted. Any idea how to lookup an initiative and navigate to the record for editing. Basically users will need to add new records and have the ability to edit existing records.
LVL 10

Expert Comment

ID: 39848320
You can add a combobox with all records, and then set the bookmark to that record the user selected.

Author Comment

ID: 39848376
Like on a pop up form or just on the form. I was looking to use the add initiative button. Thought this would easier for the end users. Maybe not...
LVL 10

Expert Comment

ID: 39848452
on the form will be easier for you to design, but you can also do it with a dialog form, depends what you want
LVL 10

Expert Comment

ID: 40080453
If you got your answer please close this question !  if you still need assistance please ask !
LVL 27

Expert Comment

ID: 41595352
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question