Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tab Controls and Combo Boxes 1

Status
Not open for further replies.

Smeg77

Technical User
Oct 7, 2009
18
GB
I'm in need of a little assistance if someone could possibly help me.

I'm trying to create a simple little db, using tabs.

I've already managed to piece together a nice little login facility, with access rigths. So that I can dispaly whih tabs I want depening on your access.

I'm now having a few issues with actually trying to get it to allow new records to be entered.

I've created a sub form, and placed it onto one of the tab Pages, but when I go to enter a record it keeps over-writing the same record, rather than going to the next record. It's been so long since I've used access and I'm not sure where I'm going wrong.

My second query is also to do with the same form, I want to place a Combo box on the form that has it's list driven from another table, but I want the answer slected to populate a field in another table.

For example:

Table 1 - Job Type - Janitor; Manager; Admin

Table 2 - Workers - (Job type field in table, to be populated from table 1)

The only reason I though of this was as an easy way to maintain the answers that could be selected in the drop down list.

If anyone can help I'd really appreciate it.
 
Suggestion: Since you have 2 separate issues here, it would be a good idea to have 2 separate posts.

Regarding your first issue of creating a new record, here are my assumptions:

1) You are not using a databound approach since you've got a tab ocx on the form and the problem is in the code.

2) The code approach is ADO rather than DAO.

3) There is a button or something to move to the next record and that is where the problem is.

If this is the case, please post the offending code or clarify where the problem is occurring.
 
Andy

Thanks for the response, and you'll have to bear with me here.

My programming skills have well and truly lapsed, and so although I can read things written and work out how they work, developing things from scratch is proving to be quite hard.

I don't really have any code to post, as I'm not sure how I'm meant to go about this. I was hoping that it would have just been a simple little refresh code that would just set the form to be ready to enter the next record.

Atm I feel like I'm trying to learn to paddle while in the deep end.

I'm sorry if my answer is a little vague but I don't think I have much I can offer, about the only thing I can do is send the mdb over, but then that would be embarassing as I'm sure I've made a right hash of things.
 

Your form is opening showing existing records.
You have to tell it to ADD NEW record if that is what you want.

Several ways to do this:
1. your users click on the add new record symbol on the bottom of the form (where it shows the record count), etc. (i don't like this method cuz it requires you to train users to do this).

2. You can have it open empty and ONLY allow new records to be added (i.e., they don't see any existing records) - by going to the PROPERTIES SHEET and setting DATA ENTRY = YES and ALLOW ADDITIONS = YES which means your form will open empty (with no records showing).

3. OR you can add a button that tell it to add a new record.

Typically - i would open the form showing existing records but allowing no edits or adding records until they selected a button. (provide both an ADD NEW & an EDIT button).
Because otherwise you would run into what you are - that the person ends up editing the first record all the time.

***********
combo box. your form should be based on the WORKERS TABLE.
Open property sheet for the form and set the record source to your workers table (or a query based on your workers table). Then click on your combo box, open the property sheet for that and set its ROW SOURCE to be the Job Type table and it's CONTROL SOURCE to be the Job Type field in the workers table.

that make sense?

 
Redwoodly, thanks for that it makes perfect sense.

I'm not back at that site until Monday so I'll give it a bash.

If it works I'll be giving you a big Man hug (a kiss is out of the question) :)
 
Redwoodly, it worked perfectly, and was simple enough for me to get my head around so thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top