Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Reset sub form to data entry

Posted on 2005-04-22
5
Medium Priority
?
485 Views
Last Modified: 2008-01-09
I need to reset the record source... The following are my code;

Private Sub cmdOpenEditHourForm_Click()
On Error GoTo Err_cmdOpenEditHourForm_Click

        Dim dmfSql As String
        Dim cmboSql As String
       
       
        'Me.FormHeader.BackColor = 32768
        Me.Detail.BackColor = -2147483633
        Me.Label102.Visible = False
        Me.Label103.Visible = False
       
    dmfSql = " SELECT tblEmployee.ClockNo, tblEmployee.Lname, tblEmployee.Fname, " _
        & " [lname] & "" "" & [fname] AS FullName, tblEmployee.Dept, tblEmployee.Supervisor, " _
        & " tblEmployee.SupEmail, tblEmployee.Resv1, tblEmployee.Resv2, tblEmployee.Resv3, " _
        & " tblEmployee.Resv4, tblEmployee.Active " _
        & " FROM tblEmployee " _
        & " WHERE (((tblEmployee.Dept)=""21"") AND ((tblEmployee.Active)=0)) " _
        & " ORDER BY tblEmployee.Lname, tblEmployee.Fname; "

    cmboSql = "SELECT [Lname] & "" "" & [fname] AS SeaarchName " _
        & " FROM tblEmployee " _
        & " WHERE (((tblEmployee.Dept)=""21"") AND ((tblEmployee.Active)=0)) " _
        & " ORDER BY [Lname] & "" "" & [fname]; "
       
        '''Change main form record source
        Me.RecordSource = dmfSql
       
        '''Change combo box back to original
        Me.Combo10.RowSource = cmboSql
       
        ''Disable subform to data entry
        Me.subformlLaborHour.Form.DataEntry = True
        Me.subformtblAttendance.Form.DataEntry = True
 
Exit_cmdOpenEditHourForm_Click:
    Exit Sub

Err_cmdOpenEditHourForm_Click:
    MsgBox Err.Description
    Resume Exit_cmdOpenEditHourForm_Click
   
End Sub

When I click on the button, the two subforms DataEntry does not return back to data entry.

Any idea??

perennial
0
Comment
Question by:perennial
  • 3
  • 2
5 Comments
 
LVL 16

Accepted Solution

by:
kmslogic earned 1500 total points
ID: 13844455
try me.subform!laborhour.form.requery
0
 
LVL 1

Author Comment

by:perennial
ID: 13844494
did you mean...

me.subformlaborhour!form.requery
0
 
LVL 16

Expert Comment

by:kmslogic
ID: 13844610
yes that's what I meant
0
 
LVL 1

Author Comment

by:perennial
ID: 13852153
I found what I did wrong...thanks for trying to help.
0
 
LVL 16

Expert Comment

by:kmslogic
ID: 13852427
Hi, ty, but if you I didn't help solve your problem please help others by posting your own solution.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question