Manipulating Datasheet Row

R

Ryan W

I have a parent-child form where the child is a datasheet that houses
multiple visits about the patient. On the child datasheet form, I have two
txtboxes, Pt Test Date and Next Test Date.

I want to have three cmd buttons that will help enter data on the Next Test
Date. Each cmdButton would be 1 Week, 2 Weeks, 1 Month. So when the user
enters a date of 9/1/2006 in Pt Test Date and clicks the '1 Week' command
button, it will enter 9/8/2006 on that rows Next Test Date. I know how to do
this if this was a single form, not sure how to do this on a datasheet form.

TIA, Ryan
 
M

Marshall Barton

Ryan said:
I have a parent-child form where the child is a datasheet that houses
multiple visits about the patient. On the child datasheet form, I have two
txtboxes, Pt Test Date and Next Test Date.

I want to have three cmd buttons that will help enter data on the Next Test
Date. Each cmdButton would be 1 Week, 2 Weeks, 1 Month. So when the user
enters a date of 9/1/2006 in Pt Test Date and clicks the '1 Week' command
button, it will enter 9/8/2006 on that rows Next Test Date. I know how to do
this if this was a single form, not sure how to do this on a datasheet form.


Do it the same way. Just make the users understand that
they must click somewhere in the row that they way to want
to set the date.

When you set a control's value, you are referring to the
instance of the control on the current record. This is very
obvious on a form in Single Form view, but the concept
applies to all forms.
 
J

John Vinson

I want to have three cmd buttons that will help enter data on the Next Test
Date. Each cmdButton would be 1 Week, 2 Weeks, 1 Month. So when the user
enters a date of 9/1/2006 in Pt Test Date and clicks the '1 Week' command
button, it will enter 9/8/2006 on that rows Next Test Date. I know how to do
this if this was a single form, not sure how to do this on a datasheet form.

Use a Continuous Form instead. It can be made to look very like a
datasheet, but lets you put a button on each row if you wish.

John W. Vinson[MVP]
 
R

Ryan W

Marshall,
If I use a datasheet, where would I be able to put my command buttons?

-- TIA
Ryan W
 
M

Marshall Barton

Put the buttons on the main form.

The code would be a little different than if the buttons
were on the subform:

Me.subformcontrol.Form.[Next Test Date] = _
DataAdd("d", 7, Me.subformcontrol.Form.[Pt Test Date])

If you would use a continuous subform instead of a
datasheet, you could put the buttons in the subform's
header/footer sections (or in the detail section as John
suggested).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top