keeping the value entered in a text box as default for next records in a form (1 Viewer)

vsk1975

Registered User.
Local time
Today, 19:46
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
 

Mark_

Longboard on the internet
Local time
Today, 07:16
Joined
Sep 12, 2017
Messages
2,111
Is this on a continuous form? If so, there are a couple trick for using a continuous form that can be rather useful.
 

vsk1975

Registered User.
Local time
Today, 19:46
Joined
Mar 28, 2018
Messages
15
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
 

Mark_

Longboard on the internet
Local time
Today, 07:16
Joined
Sep 12, 2017
Messages
2,111
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.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 10:16
Joined
May 21, 2018
Messages
8,463
. 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.
 

Gasman

Enthusiastic Amateur
Local time
Today, 14:16
Joined
Sep 21, 2011
Messages
14,042
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. :)
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 14:16
Joined
Jul 9, 2003
Messages
16,244
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

Top Bottom