keeping the value entered in a text box as default for next records in a form

vsk1975

Registered User.
Local time
Today, 07:42
Joined
Mar 28, 2018
Messages
15
Sir How can I keep once entered value(text ) in a text box as default value for the coming records till I enter a new value
 
Is this on a continuous form? If so, there are a couple trick for using a continuous form that can be rather useful.
 
sir if a user enter a value in a text box it should be taken as default value for the coming records . some times a user cannot set the default property
 
On a continuous form, if you use an unbound textbox for entry, it will retain its value. You could then update selected records to that value.

I have a form for entering medical information that uses this technique. The table it runs off of is medical requirements and it has an unbound "Date Administered' field. I then use a button to selectively add met medical requirements to an IndividualMedicalRequirement table. I am not sure if this will work in your case, but unbound controls do retain the last value entered.
 
. some times a user cannot set the default property
The user does not do anything. You write code in the after update event to set the default value for the control.
 
The user does not do anything. You write code in the after update event to set the default value for the control.

Like this. I have a checkbox on whether I wish to copy the same data to the next record.

Code:
Private Sub Date_ID_AfterUpdate()
    If Me.chkCopy Then
        Me![Date_ID].DefaultValue = """" & Me![Date_ID].Value & """"
    End If
End Sub

The .Value is not needed, but I wrote that a long time ago, when I knew no different. :-)
 
The .Value is not needed...

I recently did a Blog on this because I have noticed a couple of instances where you actually need to use "Value"

I've been meaning to blog about it for sometime! See my website HERE:-

You cannot Always omit “Value”

I have started another web page with a few of links and things, with a view to collecting enough information to do a decent sort of blog about it.

Use "Value" or Not?

Any comment criticism and feedback on this would be most welcome..
 

Users who are viewing this thread

Back
Top Bottom