By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,665 Members | 2,187 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,665 IT Pros & Developers. It's quick & easy.

Default Value set the same as last valus for field

P: n/a
This should be a nice easy one for you lot.

I have got a Combo box, with its source as a value list - there are only two
options, AM and PM.

I want to set a default value in the box, depending on what the value for
the field was in the last record.

In other words I want to fill out a form, and select either AM or PM in the
list, then in the next record I want the AM/PM box to automatically take the
value that was last used.

Thanks
JB
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Use the AfterUpdate event procedure of the combo to set its DefaultValue

Private Sub cboAmPm_AfterUpdate()
With Me.cboAmPm
If Not IsNul(.Value) Then
.DefaultValue = """" & .Value & """"
End If
End With
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"John Burns" <Jo*********@BAESYSTEM.con> wrote in message
news:40********@baen1673807.greenlnk.net...
This should be a nice easy one for you lot.

I have got a Combo box, with its source as a value list - there are only two options, AM and PM.

I want to set a default value in the box, depending on what the value for
the field was in the last record.

In other words I want to fill out a form, and select either AM or PM in the list, then in the next record I want the AM/PM box to automatically take the value that was last used.

Thanks
JB

Nov 13 '05 #2

P: n/a
Thanks,
I knew it would be a simple solution.
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:40***********************@per-qv1-newsreader-01.iinet.net.au...
Use the AfterUpdate event procedure of the combo to set its DefaultValue

Private Sub cboAmPm_AfterUpdate()
With Me.cboAmPm
If Not IsNul(.Value) Then
.DefaultValue = """" & .Value & """"
End If
End With
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"John Burns" <Jo*********@BAESYSTEM.con> wrote in message
news:40********@baen1673807.greenlnk.net...
This should be a nice easy one for you lot.

I have got a Combo box, with its source as a value list - there are only

two
options, AM and PM.

I want to set a default value in the box, depending on what the value for the field was in the last record.

In other words I want to fill out a form, and select either AM or PM in

the
list, then in the next record I want the AM/PM box to automatically take

the
value that was last used.

Thanks
JB


Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.