Technique for Opening Input Screen from Line in Datasheet

  • Thread starter Thread starter Mike Thomas
  • Start date Start date
M

Mike Thomas

In a datasheet subform where users enter a part number and a quantity in
each row, I need a way to enable the user to open a subscreen where they
will enter a list of locations and a quantity for each location.

Ideally, I'd like to put a command button in each row. It is easy to
control via code in the click event, and the user can tab thru the button
without activating it, or hit enter to activate it - they don't need to grab
the mouse.

I have not been able to find a way to get a button onto a datasheet row
though (this is a snap in other database software we use).

Does anyone know of a way to get a button onto a datasheet row, or
alternatively, of a different method of allowing the user to activate a
control in the row without having to use a mouse?

Thanks
Mike Thomas
 
I often make the Enter key open up the details form.

If you take a look at the following screen shots, you will see how I placed
a button that "repeats" on each detail lone of the form.

http://www.members.shaw.ca/AlbertKallal/Search/index.html

The code behind the button is simply:

me.Refresh ' force a disk write
docmd.OpenForm "myFormWithMoreDetails",,,"id = " & me!ID

If you want, you can also make the Enter key open up details...just use the
forms keydown event...
 
Albert,

Thanks for your help - the entire article and the link were very useful.

This will seem like a very basic question, but here it is.

How do you display a repeating button in each row of the subform? That's my
problem.

I can see sveral in your screen shots. I assume these are datasheet
subforms. Whenever I place a button in my datasheet subform, it is
invisible when I open the screen.

How are you doing this?

Thanks
Mike Thomas
 
I *always* use continues forms, and never the data sheet view.

I guess I like the control, and the fact that users can NOT re-size the
columns etc in a continues form. Further, users can't resize the form either
(I set the boarder to thin)..

Sometime, a listbox is also useful (but no buttons).

Here is a bunch more screen shots, .and you can see often I use a list box
also.

http://www.members.shaw.ca/AlbertKallal/Articles/Grid.htm

So, I just build a continues form (often, I use the wizard). And, then
simply any button you place on the form will repeat just like any text box
will.

About the only down fall of the continues form is that the up/down arrow
keys don't work, but then I put in the following code, and you get up/down
movement with the arrow keys:

Case vbKeyUp
KeyCode = 0
On Error Resume Next
DoCmd.GoToRecord acActiveDataObject, , acPrevious

Case vbKeyDown
KeyCode = 0
On Error Resume Next
DoCmd.GoToRecord acActiveDataObject, , acNext

You also have to set the forms key preview to yes for the above code to run.
 
Albert, many thanks for your time and the detailed explanation, you've
given me a lot to chew on in this thread - I guess I know what I'll be doing
tomorrow. I hate to admit it, but I've been working intensively with
Access for the past five years and have never used a continuous form.

Best regards,
Mike Thomas
 
Back
Top