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 2006

Tip: Looking for answers? Try searching our database.

Pop-up Data Entry Form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tanya Lee - 25 May 2006 15:02 GMT
I have created a pop-up data entry form to enter new employees. That's
working great, however, is there a way that I can then have that new employee
be the record that is showing when I close the data entry form.

Right now, when I close the data entry form after entering the new employee,
the record that shows up is the first record in my database.

Any help would be appreciated (and I am not a programmer, so if you provide
code, please let me know precisley where to put it - thanks).

Thank you all!
Tanya Lee
Klatuu - 25 May 2006 15:45 GMT
In your pop up form's Close event, you can use the following code.  You will
have to change the form and control names to match yours/

Private Sub Form_Close()

Dim rst As Recordset
Dim frm As Form

   Set frm = Forms!MyFormName
   Set rst = frm.RecordsetClone
   rst.FindFirst "[EmployeeID] = '" & Me.txtEmployeeID & "'"
   frm.Bookmark = rst.Bookmark
   Set rst = Nothing
   Set frm = Nothing
   
End Sub

Now, to complete the process so the selected record will be displayed in
your main form, you will need to add one line to the Activate event:

Me.Repaint

> I have created a pop-up data entry form to enter new employees. That's
> working great, however, is there a way that I can then have that new employee
[quoted text clipped - 8 lines]
> Thank you all!
> Tanya Lee
Tanya Lee - 25 May 2006 15:58 GMT
I'm sorry, which are the control names I would have to change? I inserted
your code and changed the MyFormName to the name of my form (correct???), but
I am getting an error on this part:
& Me.txtEmployeeID & "'"

Unfortunately I don't understand what I'm reading so I don't understand the
error...can you help? (And Employee ID is the field name for my autonumber
for new employees).

Thank you so much!

> In your pop up form's Close event, you can use the following code.  You will
> have to change the form and control names to match yours/
[quoted text clipped - 30 lines]
> > Thank you all!
> > Tanya Lee
 
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.