RE: button that locks fields

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Ok thanks for the advice Not to worry about the grey boxes. I want this to be
as simpleas possible.

with regards to auto number issue. I need to have a new number allocated to
each new call that is inputed. I have all the other boxes for the relevant
info to be stored, and have even created a button that will create a new
feild in the form. I need the number to be used only once and to start at
whaterver number i like. Can you sugest anything.

Also the date has worked fine except it comes out at 1428??? Any help would
be great.



"Klatuu" wrote:


--
Dave Hargis, Microsoft Access MVP


"Darren" wrote:

Many Many thanks for that.

Just a couple of other questions.

1, In a date field, is there a way of auto inserting the date?
First order of business. Forms do not have fields. Tables and queries have
fields. Forms have controls and some of those controls can be bound to
fields in the form's record source. But the short answer is if you want the
date to be today's date, put Date() in the control's Default Value property.
When you create a new record, it will automatically populate the control with
the date.

2, Also Is there a way of changing the number that a auto number starts from?
It is possible, but by asking the question, I know you are not using an
autonumber field correctly. You should not care about the value of an
autonumber and users should never see it. Autonumber field are just a tool
for creating unique value to be used as primary keys and relating tables. If
you are using it for something else, post back with what you want to do and
we can help find a better approach.

3, And on a final note now i have locked out the fields information, is
there a way of turning the feild boxes grey for example?

Yes, but it take a lot more code because you have to go through the controls
collection of the form and set each editable control's Enabled property to
False.

Many thanks again

"Klatuu" wrote:

In the Click Event of the command button:

With Me
.AllowEdits = False
.AllowDeletions = False
End With

The other thing will be to allow them back on. You could either use toggle
buttons in an option group to turn it on and off or you can put the same code
in the Form Current event except replace False with True. With this method,
whenever you move to a different or new record, editing will be allowed
again until the button is clicked.
--
Dave Hargis, Microsoft Access MVP


"Darren" wrote:

I have created a small call logging database on access. i want to create a
button that when pressed will lock all of the information in the feilds. I am
very new to this so any help would be great.


.



Relevant Pages

  • RE: Checking for null fields before running query
    ... I could use that sub and modify it so that it checks for Null in the ... return at least one record when all 3 controls have values. ... 3 cbo boxes, 2 buttons, 12 txt fields. ... the cboboxes provide parameters for a query, and also criteria for 12 DSum ...
    (microsoft.public.access.modulesdaovba)
  • Re: Adding Code to a Command Button Added At Run Time
    ... I know you want to use text boxes, or rather started off with using these ... The textbox is for manually entering the path/filename. ... and Label control added to it at run time. ... how to add the three controls to my form at run time. ...
    (microsoft.public.vb.general.discussion)
  • RE: button that locks fields
    ... Dave Hargis, Microsoft Access MVP ... with regards to auto number issue. ... Forms have controls and some of those controls can be bound to ...
    (microsoft.public.access.gettingstarted)
  • RE: Checking for null fields before running query
    ... I could use that sub and modify it so that it checks for Null in the ... return at least one record when all 3 controls have values. ... 3 cbo boxes, 2 buttons, 12 txt fields. ... the cboboxes provide parameters for a query, and also criteria for 12 DSum ...
    (microsoft.public.access.modulesdaovba)
  • Re: 3 linked combo boxes in a form Options
    ... Posted via a free Usenet account fromhttp://www.teranews.com- ... If you have only a few text or combo boxes to clear, ... controls you need to clear to "Clear Me" and run the following code ... set ctlx = me.controls ...
    (microsoft.public.access.formscoding)