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!

easy Access problem...I think...relationships bad? 3

Status
Not open for further replies.

BoyWonderDesigns

Programmer
Dec 26, 2006
24
0
0
US
Hi my first post here, so bear with me.

I am doing a small database for a friend and having a bit of trouble. It has been several years since I did any Access, and I am apparently more rusty than I thought!

I have a 4 tables:
1) Pickup info (Prim. Key: Autonumber): address, phone, contact name
2) Deliver info (Prim. Key: Autonumber): address, phone, contact name
3) Billing info (Prim. Key: Autonumber): address, phone, contact name
4) Work Order (Prim. Key: Autonumber. Also contains the foreign keys for each of the above): date, 'entered by' name, and comments

On a single form, I have subforms for each of the other 3 tables' data (all the address info, etc.) then the couple other fields for work order date, comments, etc.

When you pull up a new form sheet, it will only let me enter data in the subforms, not for the work order fields (and it won't increment the work order Autonumber key, which I assume is the main problem here). I know this a really simple solution, since I remember doing databases like this before, but just can't remember what to do with it.

The relationships are all one-to-many

What am i doing wrong here...please rake me over the coals! LOL

THANKS experts!

Happy holidays
 
ok, got it..and on the button, I can have it just launch a little mini form for the new contact info entry..they enter the new one, close it and the new records should show up in the list now, right?
 
yes, when the button is pressed, a mini form can open to add the new contact. You have to refresh the query or table that controls the dropdown in order to get the latest additions.
 
OK I assume I have to add some coding to the Event Procedure to refresh the table data after adding the new record, right? Any words of wisdom on that? Thanks...I can see it coming together now, thanks for your guidance!

 
Hey BoyWonder...

try this code in the VB event procedure:

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, ,acMenuVer70

I'm no expert, but it does work for refreshing my form data.
 
Hi dogg, yes that part I got, but the trick is that refreshes the current form...it's the underlying form (the main form, not the add-contact form that just popped up) that needs to be refreshed...I assume it can be done from the Event Procedure coding, by just telling it the underlying form name, but I am not sure how to structure the command
 
In the button's Click event procedure:
DoCmd.OpenForm "NewContactForm", , , , acFormAdd, acDialog
DoEvents
Me![combo name].Requery

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
ok PHV, let me make sure I am clear:

DoCmd.OpenForm "NewContactForm", , , , acFormAdd, acDialog
(the above is what is already under Click event for opening the form to add a new record, right?)


DoEvents
Me![combo name].Requery

Just cut and paste this below the DoCmd line and change it to my listbox field name?

Thanks for your help!
 
Be sure to open the popup form as modal (acDialog)
I thought you had a combobox instead of a listbox ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
this is what's currently on the Event Procedure:

stDocName = "FRMContact subform"
DoCmd.OpenForm stDocName, , , stLinkCriteria

do I need to replace that with your line for acFormAdd?

or is your line in addition to the lines I pasted above?
 
Try this:
DoCmd.OpenForm stDocName, , , stLinkCriteria, , acDialog

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
AWESOME! Man, I'm moving on now! Thanks for everyone's help so far!

Hopefully this will get me on my way. Happy holidays to everyone!

JB
 
one last question, and I think I am home free... I need the new contact form to open on a new, blank record so they can just enter and close it out... is this just a matter of adding a parameter to the existing statement? I tried adding a DoCmd...acNewRecord on the next line, but that didn't do it?

 
I guess the question is does your statement you had me put in need to have another parameter to have it go to a new record for entry

i also get the feeling I will need an edit button where they can select a person then hit edit to bring that person up to make edits...shouldn't be difficult, should it?
 
OK, update...got the form working to perfection...thanks for everyone's help!

I have a question on the report now..will ask in a separate thread
 
Well, I'm glad you got it working, sorry I wasn't around over the holiday to assist, but it looks like you didn't need it or found it from someone else.

Happy New Year!

Leslie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top