"On Current" property question

That's a good question.
The situation is that at this point they are entering 4 pieces of information:
- Return date of the tote
- Condition of the tote (from drop down list)
- Return date of the lid
- Condition of the lid (from drop down list)
I can't really foresee how these fields would need to be edited in the future. Maybe if they mistakenly entered a condition of "excellent" and they meant to enter "poor"? But they could change that at the point of entry . . . Can you see something that I'm missing in this regard?

Edit
There are several totes and several lids that ship out at one time (on 1 transaction)
 
Last edited:
What is I see is an issue because if they mistakenly enter *excellent* and want to change, they will not be able to since the field will be locked once it receives a value. They will have no option to change to *poor*.

Perhaps it would be better to lock the fields that have data once they leave the record? This gives them a chance to make changes in the case of wanting to update a condition. What do you think?
 
YES YES. That would be ideal!
 
Okay please post what you have here, so I can modify... (I want to make sure of which one you are using before I make the change.)
 
I copied the form, query, and required tables into a new database (2007) and have it attached. Please let me know if you were looking for something else.
 

Attachments

Even better I'll look at that in a few minutes... I really do have a day job and today it's getting in the way of me answering... :eek:
 
Those day jobs really do get in the way of stuff don't they?!
Seriously, I appreciate EVERYTHING!! At whatever pace you can do it!
 
oh, I need to mention - I took out the code we were working on before in preparation for whatever new "stuff" was coming my way
 
Okay, I can't get it to work on your Form and I'm trying to figure out what is so special here that it won't follow instructions. I am only telling you this so you don't think I abandoned you. I'm on a mission to get this working!
 
Do you need something else from me? Did I give you all the tables and stuff needed?
 
Nope, got everything I need... I tested it and it works in a database of mine but not in yours. So, I just need to figure out why...
 
I am wrapping it up here for the day. I am required to leave at 4:30pm. I'll be back in the office tomorrow morning. I work a half day on Wednesdays - and then I'm not back in again until next Tuesday for my full day. So if I don't catch you during these times no worries I WILL be back. Thank you!
 
Oh, I'll get it... and I HOPE it's soon because driving me nuts!
 
Okay, finally...my own fault (probably needed more coffee) but i think it's doing what you want now...
 

Attachments

I want to get me some of that coffee!! YOU ROCK!

Yes, this is exactly what I needed.

I was looking at what you did. I see there are no events at the control/field level. There is just the one event on the On Current property of the form. I know virtually nothing about code - can you help me out by telling me what you are telling it to do (for my education)? It appears as though you're saying "if a text box or a combo box with the tag of Lock Me is not null . . . ." That's about all I get.

Thank you so much Gina (smart as a) Whip! ;)
 
THANKS for the kind words! Still laughing at the pun! :D

The code with explanation...

Dim ctl As Control
'For every Control that is a Text Box or a Combo Box
Code:
    For Each ctl In Me.Controls
        If ctl.ControlType = acTextBox Or ctl.ControlType = acComboBox
Then
'If the Control is Empty or Null AND the Tag property (of the Control) says LockMe
Code:
            If Not (IsNull(ctl.Value) Or ctl.Value = "") And ctl.Tag = "LockMe"
Then
'Lock it as long as it's not a New Record
Code:
               ctl.Locked = Not Me.NewRecord
'NOT using the line below because is just locked everything
Code:
               'ctl.Locked = True
End If
End If
'Loop until you have checked all the Text Boxes and all the Combo Boxes
Code:
    Next ctl

Crystal has some excellent ltutorials and YouTube videos (search for Crystal Long on YouTube) and one of them is on SQL. Have a look here...

A free tutorial written by Crystal (MS Access MVP)...
http://allenbrowne.com/casu-22.html
 
This is most helpful. Thank you again. I will most certainly check out that tutorial. (Wish I had an image of a humble smiley to go right here!)
 
No problem and if you run into issues/questions we're only a click away! :)
 

Users who are viewing this thread

Back
Top Bottom