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

e-mail Current Form Record as a Report & Menu Solutions

P: 21
Right I'm don't feel so nervous tackling VB as much now but basic stuff I'm great with so the next part of my script is:

1. Having a Front Menu. When you enter the number 1 in a textfield it selects formA, number 2 selects formB etc how would I do this?

2. E-mail Current Form Record. I found a similar thread to this but I used its code and it didn't work anyone got any ideas, I've managed to create one for Printing but not mailing any help would be appreciated!
Dec 22 '07 #1
Share this Question
Share on Google+
5 Replies


Nathan H
100+
P: 104
Right I'm don't feel so nervous tackling VB as much now but basic stuff I'm great with so the next part of my script is:

1. Having a Front Menu. When you enter the number 1 in a textfield it selects formA, number 2 selects formB etc how would I do this?

2. E-mail Current Form Record. I found a similar thread to this but I used its code and it didn't work anyone got any ideas, I've managed to create one for Printing but not mailing any help would be appreciated!

Mark,

Something along this line would work for question 1.

This takes the value in a text box (txt1) and selects a form based on the value. I put this code on a command button

[Code = vb]
Private Sub Command0_Click()
If txt1 = "1" Then DoCmd.OpenForm "FormA"
If txt1 = "2" Then DoCmd.OpenForm "FormB"
End Sub
[/code]

Nathan
Dec 23 '07 #2

P: 21
Mark,

Something along this line would work for question 1.

This takes the value in a text box (txt1) and selects a form based on the value. I put this code on a command button

[Code = vb]
Private Sub Command0_Click()
If txt1 = "1" Then DoCmd.OpenForm "FormA"
If txt1 = "2" Then DoCmd.OpenForm "FormB"
End Sub
[/code]

Nathan
Thanks Nathan, I stuck it it as onEnter instead of a Command Button and it works like a charm :) Many thanks and Merry Christmas :D
Dec 24 '07 #3

missinglinq
Expert 2.5K+
P: 3,532
The OnEnter of what? Be aware that OnEnter will only fire if your user(s) tab into a control, not if they use the mouse and click into it. OnEnter events really should only be used to do things related to that particular control, not to fire code for such things as opening forms. If you always want a form to open when you enter data into txt1, it's AfterUpdate event would be more appropriate.

As for the emailing problem, you ought to post the code that you've tried.

Linq ;0)>
Dec 25 '07 #4

P: 21
REF: e-mail Current Form Record as a Report

I've deleted the code because it was just being way to messy so if anyone has a code from scratch that would be fantastic :)
Jan 2 '08 #5

P: 21
Found solution to this just had to modify the code a little
Mar 17 '08 #6

Post your reply

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