473,566 Members | 2,908 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

21 New Member
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
5 1722
Nathan H
104 New Member
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
Marks
21 New Member
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
3,532 Recognized Expert Specialist
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
Marks
21 New Member
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
Marks
21 New Member
Found solution to this just had to modify the code a little
Mar 17 '08 #6

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

Similar topics

3
11856
by: sea | last post by:
I need to be able to print the current form because the form has an embedded object of a .gif file, so report will not work -- does anyone know the way to do this? I tried some code, not sure what it was now, guess docmd.printout or something but that prints ALL the forms -- also the each page of the form does not always start at the next page...
3
1849
by: Simone | last post by:
Hi, I'm a DB newbie and I've been having issues trying to print the record I am viewing in a form to a report. I have looked in groups all over and they all say to try basically the same thing but I can't get it to work. This is the latest code I've tried: Private Sub NewRepairPrintPreview_Click()
0
1040
by: Sumit | last post by:
Hi, I have a MDI Windows form. I have a menu bar on the from. The requirement is that the menu items that i put in the menu bar should come in the normal way (i.e start from left to right or say "left alligned") but the last one of the menu items i want at the right most part of the menu bar. for eg. if there r five menu items say...
16
10106
by: usenet | last post by:
I want to be able to use the record numbers of a sub-form, are they available anyhow in VB (Access 2003)? I want to use the sub-form record number as *part* of the primary key for the table whose data is displayed on the sub-form. The other part of the primary key is the column used to join to the master table. E.g. I have TableA (the...
3
1482
by: Deacon Dan | last post by:
I want to be able to keep the current form on the current record. That is, the arrow key, the tab or the enter should not cause the form to go to next record or previous record. Preferably loop from last tab stop to first and visa versa.
4
1735
by: gary.cobden | last post by:
Hi I have a form/subform where a new record is created on the subform by a button click. After the new record is created, I then need to go directly and display the new record in the subform. My current code is:-
2
1839
by: herbiegrey | last post by:
Hello This is my first post on the forum so hello everyone. I have a problem with access that I can't manage to view the current form record as a report ready to be printed. I have a list of clients that when viewed in a form, i need to be able to generate a letter with their details already filled in. I've tried various version of...
9
14206
Microblitz
by: Microblitz | last post by:
Two weeks (Well about 8 hours actually) into writing VBA code and I've run up against a problem. This is the senario; ---- I have a "Main" form in which an entry on a drop down selects one of three types of test. The type of test designates the type of form used to enter the data. Therefore when my drop down select type 2 from its...
0
988
Knut Ole
by: Knut Ole | last post by:
Hi, I have a mainform for a new camping reservation, with a subform for entering a new contact upon making a new reservation. I also have a subform for editing a contact on-the-run when making a new reservation. I've become a bit confused, however, as to whether I'm organizing it correctly, and I plain wonder how to update the respective...
0
7673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7893
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8109
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7645
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7953
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1202
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
926
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.