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 Programming / May 2008

Tip: Looking for answers? Try searching our database.

Setting a default value

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rosebud - 21 May 2008 22:10 GMT
I have a form that contains a control [CourseCategory].  There's another
control [Category] on the same form.  For new records, I'd like the value of
Category to default to the value of CourseCategory.  I've tried setting the
Default Value property of Category to CourseCategory but that doesn't seem to
work.  I read somewhere that this might be because the form doesn't know the
value of CourseCategory until after the update.  So I tried using SetValue in
a macro that runs AfterUpdate.  No luck there either.  This sounds like it
should be simple but I've spent hours on it.  Help please!  And I'm not a
coder so I'd prefer an answer that doesn't involve writing code.  Thanks.
Klatuu - 21 May 2008 23:03 GMT
In the After Update event of CourseCategory, populate Course

Private Sub CourseCategory_AfterUpdate()
   Me.Course = Me.CourseCategory
End Sub
Signature

Dave Hargis, Microsoft Access MVP

> I have a form that contains a control [CourseCategory].  There's another
> control [Category] on the same form.  For new records, I'd like the value of
[quoted text clipped - 5 lines]
> should be simple but I've spent hours on it.  Help please!  And I'm not a
> coder so I'd prefer an answer that doesn't involve writing code.  Thanks.
Rosebud - 22 May 2008 12:51 GMT
This isn't working.  The Course field is still blank after the update.  And
wouldn't this reset the value of Course for ALL records?  I only want this to
happen on new records as a default value.

> In the After Update event of CourseCategory, populate Course
>
[quoted text clipped - 11 lines]
> > should be simple but I've spent hours on it.  Help please!  And I'm not a
> > coder so I'd prefer an answer that doesn't involve writing code.  Thanks.
Klatuu - 22 May 2008 15:05 GMT
I have no idea why this would not work.  It is pretty straight forward.  It
should only affect the current record.  As to trying to set a default value,
since the record is already created by the time you get to this point, it is
too late.

Signature

Dave Hargis, Microsoft Access MVP

> This isn't working.  The Course field is still blank after the update.  And
> wouldn't this reset the value of Course for ALL records?  I only want this to
[quoted text clipped - 15 lines]
> > > should be simple but I've spent hours on it.  Help please!  And I'm not a
> > > coder so I'd prefer an answer that doesn't involve writing code.  Thanks.
Jan Baird - 27 May 2008 20:50 GMT
Jan Baird is out of the country until September 20.   Every effort will be
made to respond to messages, but please be patient.
 
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.