Link to home
Start Free TrialLog in
Avatar of WarrenGlass
WarrenGlass

asked on

How to add rows of data for the same ID?

I have a table with three columns:  PersonID, FreeDate and FreeTime.  I made a form with three combo boxes to select the three items from three separate sources.  This works.  What I need help on is when I select the PersonID, I want to keep selecting FreeDates and FreeTimes for the same person without having to re-select the PersonID each time.  Any suggestions on the best way to do this?

Warren
Avatar of TextReport
TextReport
Flag of United Kingdom of Great Britain and Northern Ireland image

Check out the MS KB article http://support.microsoft.com/default.aspx?scid=kb;en-us;q210236 this is titled ACC2000: Fill Record with Data from Previous Record Automatically or alternatively use a form and subform with the personid on the main for linking to the subform.

Cheers, Andrew
Hi WarrenGlass,

Assuming that the PersonID TextBox on your form called "PersonID", then on the form's AfterUpdate event place something like:

Private Sub Form_AfterUpdate()
    Me.PersonID.DefaultValue = Me!PersonID
End Sub

This will set up the default value of PersonID for the next entry phase.

HTH,

Nosterdamus
ASKER CERTIFIED SOLUTION
Avatar of nico5038
nico5038
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
 - PAQ'd and pts removed
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

Nic;o)
Avatar of WarrenGlass
WarrenGlass

ASKER

Hi Nic;o,

I did not get this to work the way I wanted before I had to work on another project.  I will be back on this Wednesday and will either accept an answer or expand on my question.  Thank you for following up!!!!!!

Warren
Hi Warren,

I'm just cleaning the old Q's as they are unlikely to draw new comments.
When this didn't solve the problem, I'll change my recommandation into:
 - PAQ and pts refunded
thus enabling you to post a new (expanded) question.

Keep me posted ;-)

Nic;o)
Thanks to everyone for your responses!  The accepted response worked as soon as I remembered to set up the relationship between the two tables.

Warren
Glad I could help ;-)

Success with the application !

Nic;o)