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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Subform Inventory Transaction 2

Status
Not open for further replies.

MrNick

Technical User
Jan 12, 2003
10
US
I have been building and inventory program for my business using Access. So far so good. But as the year has gone by my employees spend a considerable amount of time scrooling down the the last row to enter a new transaction. Is there a way that I can make the next transaction entry appear at the top of the form other than at the bottom?
 
Instead of over-using the same form for editing and data-entry, you could make a copy the form and set the DataEntry property of that new form to Yes.

Furthermore, you could make a shortcut to this new data-entry form on the desktops of those people who enter the most data into your database. --Shaun Merrill
 
Okay, I understand that. However how will I be able to access the old information/customer history. Secondly, I would still like the ability to have the first data entry slot to appear at the top of the subform instead of scrooling down or hotkeying to the bottom to post a new entry.
 
I can think of 2 quick ways to resolve this.

1. In the On Open event, put this code in:

DoCmd.GoToRecord , , acNewRec
[WhateverTextBox].SetFocus


OR

2. Put a 'NEW RECORD' button on the form somewhere to do the same thing.

Setting the focus to the first text box where the data entry person starts typing makes it a bit easier instead of using the mouse.

;)
 
DoCmd.GoToRecord , , acNewRec
[WhateverTextBox].SetFocus gives me the error message can not find DoCmd link.
 
Or should I say the macro for that command does not exist.
 
Go to the On Open event of the form. See the build button at the end of the line (3 dots) click it, build a new event procedure. Add the DoCmd line and setfocus lines in the vb code section.

;)
 
Okay, did that; but still opens as before. Next record to enter down at the bottom. Obviously I'm missing something. My first date entry field is TransactionDate I put that in the [Whatever TextBox] as you directed. Missing something simple I just know it.
 
As Shaun Merrill said earlier, setting the dataentry to yes would be the way to have a new record line to be shown at the top of the form. But since you require the other data there as well, then moving to a new record when the form opens or a button is pressed is the only simple way around this.

There may be another way, but it would be a little more difficult. The main form you have that shows all the records, keep it as is. Like Shaun said, copy the form and give it a different name and set the dataentry to yes.

Then back in the main form in the header or footer section, add a new subform, based on the one you copied. Having this would give you the best of both worlds, i.e. scrolling records in the middle of the screen to review/edit records with a single data entry point.

If you do it this way then adding a new button to the subform wont hurt either.

;-)
 
Sorry MrNick, scratch that last one, cant have a subform on another form that is set to continuous.

Moving to the bottom of the form using DoCmd statement may have to suffice.

:-(

 
Yep, It was just a matter of time before I nutted this one out.

Set the DataEntry to Yes,
Set the DefaultView to Single form

Move the text boxes in the detail section into the header section.

Now, in the detail section add a list box based on the same query/table that the form is based on.

Wulla, you now have a form that

1. goes to a new record at the top of the form
2. shows all the other records that have been entered

The only downside is that you cannot edit the other records directly, but with a bit of coding that can be fixed.

;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top