Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / May 2008

Tip: Looking for answers? Try searching our database.

Way for Combobox to default to last value?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DominicGreco - 16 May 2008 12:55 GMT
I've been trying to find a way to get Access to default to the last entered
value for a combobox in a field.

Here's the scenario: User inputs data into multiple combo boxes on form,
saves record and moves to next "blank" record. When the new record shows up,
the default value on some of these combo boxes is what was entered on the
last record. It sounds like a "On Open" macro function. But I can't find the
switch to do so.

Any help?
scubadiver - 16 May 2008 13:31 GMT
For a database I developed in an old job I used the following code in the
double click event of a button to create a new record that had replicated
information.

Just change the field names.

Private Sub TempSt_DblClick(Cancel As Integer)

With Me.RecordsetClone
    .AddNew
    !EmployeeID = Me.EmployeeID
    !WeekID = DateAdd("d", 7, Me.WeekID)
    !Dept = Me.Dept
    !Subdept = Me.Subdept
    !Costcentre = Me.Costcentre
    !Rate = Me.Rate
    !Contracthrs = 0
    !timehalfhrs = 0
    !doublehrs = 0
    .Update
End With

end sub
DominicGreco - 16 May 2008 14:12 GMT
Thanks for the suggestion. I would probably just atach this code behind my
"Next Record" button. This way all the field values I want to save are saved
when I hit it.

I'm assuming that the line of code with the "!" extension are your user
variables. And that these correspond to field names whose value you wanted to
save. Correct?

I can see where this saves them. But how do you populate the list or text box
with the appropriate value? Or how do you recover the saved information?

>For a database I developed in an old job I used the following code in the
>double click event of a button to create a new record that had replicated
[quoted text clipped - 19 lines]
>
>end sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.