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

SendKeys: second form to filter main form, Access 2003

P: 14
Hi All,

I am stuck on a problem and hope someone can help me out. I have 8 users who will be using a form [Frm_main]. For the users to access their accounts I use the SendKeys function, the user click on their name to access their records. Each user has over 300 accounts and it is a growing list.

On my main form [Frm_main] whose record source is a query based on [Tbl_detail], I have a button on the main form which open a pop up form [Frm_review], the source for this form is a query based on [Tbl_detail]. The pop up form only display records that needs to be reviewed for today. On the pop up form [Frm_review] I have a button [Filter] when a user clicks on those records are filtered on the main form. The problem I have is when the user click on it a screen popís up asking to enter user. When I enter the user the records are filtered on the main form. Is there a way I can program the button so that it does not ask for a user. The code below is for the [Filter] button.


Private Sub Filter_Click()
Dim code As String

code = "[ReviewDate]= Date()"

DoCmd.OpenForm "Frm_main", acNormal, , code

DoCmd.Close acForm, Me.Name

End Sub


Everything Iíve read on the internet pretty much say I should stay away from using SendKeys. Any advice or suggestion I would greatly appreciate, thank you!
Dec 17 '07 #1
Share this Question
Share on Google+
1 Reply


P: 14
Hi All,

I am not sure if anyone was looking into this but I wanted to let everyone know that I decided to change my approach. Dealing with sendkeys is to much problem. I decided to change the RecordSource for each user and it is working great. Here is the code I use in case someone else has the same problem, it is simple.

Private Sub LogginT_Click()
Dim SQL As String

SQL = "SELECT * FROM Tbl_detail WHERE ((Tbl_detail.User)='Tom');"

DoCmd.OpenForm "Frm_main", acNormal

Forms! Frm_main.RecordSource = SQL
End Sub
Dec 21 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.