RE: button that locks fields
- From: Darren <Darren@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 10 Oct 2007 15:58:02 -0700
everytime i create a new field the edit button will only work if you go to
the code and come out of it
hope this heps
"Darren" wrote:
I think i will leave the number issue for the moment. With reagrds to the.
date issue not sure. Is there anywhere to look.
I have just made the final draft of the button we spoke about and now it
wont wirk any ideas? just entered all the fields with data and then hit the
button and when one of the fields is selected you can carry on adding info?
thanks darren
"Klatuu" wrote:
--
Dave Hargis, Microsoft Access MVP
"Darren" wrote:
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.
You can create a fake autonumber. Each time you add a new record you can
determine the highest number currently in the field and add 1 to it. This
you do in the form's current event. You only do it for new records:
If Me.NewRecord Then
Me.txtCallNumber = Nz(DLookup("[CallNumber]", "CallTable"),0) + 1
End If
If you want to start at a specific number, put a record in the table with
the number you want to start with - 1 (I think), because the next new record
will be one higher than the value in the record you start with.
Also the date has worked fine except it comes out at 1428??? Any help would
be great.
Is the table field a date data type? Are you using any formatting on the
control?
"Klatuu" wrote:
--
Dave Hargis, Microsoft Access MVP
"Darren" wrote:
Many Many thanks for that.First order of business. Forms do not have fields. Tables and queries have
Just a couple of other questions.
1, In a date field, is there a way of auto inserting the date?
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.
It is possible, but by asking the question, I know you are not using an
2, Also Is there a way of changing the number that a auto number starts from?
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.
- Follow-Ups:
- Re: button that locks fields
- From: John Spencer
- Re: button that locks fields
- References:
- RE: button that locks fields
- From: Darren
- RE: button that locks fields
- From: Klatuu
- RE: button that locks fields
- From: Darren
- RE: button that locks fields
- From: Klatuu
- RE: button that locks fields
- From: Darren
- RE: button that locks fields
- Prev by Date: RE: button that locks fields
- Next by Date: Re: problem with "Insert Into"
- Previous by thread: RE: button that locks fields
- Next by thread: Re: button that locks fields
- Index(es):
Relevant Pages
|