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

Subform data entry layout problem ?

Status
Not open for further replies.

storyboy

Programmer
Sep 16, 2004
25
US
Have simple data entry layout subform, continous form type
(Yes, a newbi, who needs help badly), yet I love Access.
When the form is active for entry the form produces two lines of fields for entry. The first line has pencil symbol. Then lower is a line of fields same as above with an * which also allows data entry.
I don't want that Lower line to be there. All I want to do is enter the data one line after another.
This subform is the detail portion of Invoicing form, data entry. It all sounds so simple, most has been, then there is things like this. Please assist, and Thank you so much for the time you take to assist me. It is appreciated lots.
Tom
 
What you are discribing is a contineous form with the defaults settings for data entry. The Pencle icon indicates the record being edited. The * is where a new record is added.

To turn off * line you actually have to set the subform not to allow additions. (Open the subform in design mode, ensure the Properties window is open -- from the menu, "View" -> "Properties"; look at the "Data" tab and set the value for "AllowAdditions". If you do not see this field in the Data tab, it means you are looking at the property for a control object on the form. Select the table by clicking on the top left square where the verticle and horizontal rulers meet)

Now that you have turned off "allow additions" how are you going to allow the end user to add records?? Well, you are about to get your feet wet. Here is one way...

Add a toggle button to the header of the subform. Select the toggle button and click on the "Events" in the Properties window. Click on AfterUpdate field and select "[Event Procedure]" then click on the "..." command button that appears to the right of the selected field. This will take you to the VBA coding window. Add the following...

Code:
If Me.[COLOR=blue yellow]YourToggleButtonName49[/color] Then
    Me.Caption = "Add"
    Me.AllowAdditions = True
Else
    Me.Caption = "Read"
    Me.AllowAdditions = False
End If

You will have to change the name of the [COLOR=blue yellow]control object name[/color] to match the name of the control on your form. When you create the event procedure, Access will automatically assign a name such as...
Private Sub Toggle49_AfterUpdate()

The name of the object will be the prefix before the "_AfterUpdate".

Now the end user can toggle the command button up and down to allow and not allow additions. Edit the caption name to meet your needs.

Is the water warm? ...or to cold for now?

Richard
 
Whoops - one oversite...

Code:
If Me.[COLOR=blue yellow]YourToggleButtonName49[/color] Then
    Me.[COLOR=blue yellow]YourToggleButtonName49[/color].Caption = "Add"
    Me.AllowAdditions = True
Else
    Me.[COLOR=blue yellow]YourToggleButtonName49[/color].Caption = "Read"
    Me.AllowAdditions = False
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top