473,583 Members | 2,858 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

forms: simple and complex question

Hi,

I'm trying to accomplish the following on a form on which i have
removed navigational buttons (I apologize in advance if this is too many
questions);

The two easy ones are....
1) When the user opens the forms I would like it to open to a blank
form so they can create a new record (I don't want fields populated with
the first record from the table). The user should also have the option of
searching for a particular record.

2) Would like to do some data testing done on the data the user
entered in the forms before it updates the table. Basically i would like to
concatenate a certain amount of zeros to what they entered using a loop.
Where do i place this code?

The more difficult one...
3) Would like to add a button to a form that would create and save a
CSV file by joining certain tables in the DB. The user should be prompted
to where he/she wants the file saved.

TIA

Nov 13 '05 #1
6 1912
1. Set the Data Entry (and Allow Additions) property of the form to "Yes"

2. Not sure what you mean by "data testing". You can use the Format
property of your controls to pad leading or trailing zeros (if that's what
you want).

3. A query of your two tables will create a recordset of the data in both
tables. Make that query a "Make Table" one and follow the prompts to select
a file type and location.

-Ed

"someguy" <in*********@ya hoo.com> wrote in message
news:Xn******** *************** **********@216. 196.97.142...
Hi,

I'm trying to accomplish the following on a form on which i have
removed navigational buttons (I apologize in advance if this is too many
questions);

The two easy ones are....
1) When the user opens the forms I would like it to open to a blank
form so they can create a new record (I don't want fields populated with
the first record from the table). The user should also have the option of
searching for a particular record.

2) Would like to do some data testing done on the data the user
entered in the forms before it updates the table. Basically i would like
to
concatenate a certain amount of zeros to what they entered using a loop.
Where do i place this code?

The more difficult one...
3) Would like to add a button to a form that would create and save a
CSV file by joining certain tables in the DB. The user should be prompted
to where he/she wants the file saved.

TIA

Nov 13 '05 #2
Hi someguy,

I'm not too sure about Question 1...I think you can set the Form's
..CurrentRecord property to the last record, in the Form's OnOpen event
handler.

2) If you can write the code, you can either make it a public function
within a standard code module (i.e. in the VBE Project Explorer, under
'Modules') OR you can make it a private function within your form's
class module (i.e. in VBE Project Explorer, under 'Microsoft Access
class object')

3) I have done this before and tackled it in two ways:
Firstly, you can use the TransferSpreads heet method in your button's
OnClick code, to transfer your data to a spreadsheet(whi ch can be saved
as a .csv file). See the Help file in Access VBA for using this method.
Then, I suggest you read the following link, it has some useful tips on
automating Excel from another application - in your case saving the
file and prompting the user where to save.

Hope that helps!

Regards,
Jean

Nov 13 '05 #3
Hi Jean,

Thanks for your reply. Just another question about #2. I already
have the code written in a VBA module that works with an update query.
I have a button labelled "update" that transfers the form data to the
table. How do i call my code when this button is pressed? In the code,
how do i reference the fields values in the form?

Many Thanks,

Inderjit

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #4
Hi Ed,

Thanks for your suggestions, i'll try that as soon as i get a
chance. I have already tried what you sugguested in #1 but when i do
that i can't add a button to do a record search.

Thanks,

Inderjit

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #5
There seems to be a basic misunderstandin g here. Most data entry forms have
a record source, so that the form's controls are "bound" to the underlying
table/query. You're working with a dynamic recordset and any
additions/edits/deletions are made immediately (actually, when Jet finds a
free moment) to the table/query. For that setup, there is no need to run
any update query or "transfer" data to the table. Access/Jet does all that
for you automatically.

The form's Allow Additions, Allow Edits, Allow Deletions, etc., properties
refer to the record source, NOT whether you can add/delete controls on the
form.

Look at Northwinds, or any of the template generated databases to see how
most developers and users set up data entry forms. Unbound forms and
controls are used mostly to capture user inputs that are not stored anywhere
and/or to show the results of calculations (that also should not be stored).
It is possible to set up unbound forms/controls for data entry, but why
spend all that time to try to fix something that's not broken?
-Ed

"Inderjit Rai" <in*********@ro gers.com> wrote in message
news:42******** @127.0.0.1...
Hi Jean,

Thanks for your reply. Just another question about #2. I already
have the code written in a VBA module that works with an update query.
I have a button labelled "update" that transfers the form data to the
table. How do i call my code when this button is pressed? In the code,
how do i reference the fields values in the form?

Many Thanks,

Inderjit

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 13 '05 #6
Just to #1 -
In the form's OnLoad event, you can use code like this:
DoCmd.GoToRecor d , , acLast

HTH
- Turtle

"someguy" <in*********@ya hoo.com> wrote in message
news:Xn******** *************** **********@216. 196.97.142...
Hi,

I'm trying to accomplish the following on a form on which i have
removed navigational buttons (I apologize in advance if this is too many
questions);

The two easy ones are....
1) When the user opens the forms I would like it to open to a blank
form so they can create a new record (I don't want fields populated with
the first record from the table). The user should also have the option of
searching for a particular record.

2) Would like to do some data testing done on the data the user
entered in the forms before it updates the table. Basically i would like to concatenate a certain amount of zeros to what they entered using a loop.
Where do i place this code?

The more difficult one...
3) Would like to add a button to a form that would create and save a
CSV file by joining certain tables in the DB. The user should be prompted
to where he/she wants the file saved.

TIA

Nov 13 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
518
by: Volker Zink | last post by:
I am writing my first schema and have 3 complex types which represent "top level objects": <complex type name="A1"> .... </complex type> <complex type name="A2"> .... </complex type>
25
6187
by: Steve Jorgensen | last post by:
Yup, Steve's full of tips, but hey, it makes him feel important, right? Ok, here goes. I've been trying to improve encapsulation by putting code in the same object as the stuff it affects, so I rarely refer to a subform ir parent form's controls or records from the other form. Instead, I call a procedure in that form that does the job. ...
19
4083
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate the code that implements managing unbound controls on forms given the superior performance of unbound controls in a client/server environment. I can...
2
4655
by: James X. Li | last post by:
Is there a way to implement multiple login forms for ASP.NET applications? With our application we want to implement simple login form for normal resources (downloadable files), but more rigorous login forms for tasks like administration and configuration. The current ASP.NET seems only to allow to a single login form via the authentication...
5
5326
by: ~~~ .NET Ed ~~~ | last post by:
Hi, As you all know when an ASP.NET web form is created that will include web controls and such, it contains a FORM that that identifies the web form and its containing controls. Well, I have a web form who has several other (user & custom) controls, these are enclosed within the standard FORM tag. Additionally *some* of these user...
7
2274
by: abcd | last post by:
I am trying to set up client machine and investigatging which .net components are missing to run aspx page. I have a simple aspx page which just has "hello world" printed.... When I request that page like http://machinename/dir1/hellp.aspx instead of running that page it starts downloding ...whats missing here ....why the aspx engine...
34
2059
by: Luke | last post by:
Hi! I am new to PHP but I am a very experienced in Perl/CGI/templates. I work in medical informatics when we deal with very large data collection forms. Some of them have over 1000 elements! Forms are not outputted by PHP, they are designed by nurses using various visual HTML editors /drag & drop/. Ok, it is relatively easy to get all the...
9
13330
by: garyusenet | last post by:
I am using a C# solution that somebody kindly sent me. It was a console application. I am trying to get use of the MessageBox. I have added the following using directive to the namespaces at the start of the program : - using System; // I've added this...
19
248082
Atli
by: Atli | last post by:
Introduction At some point, all web developers will need to collect data from their users. In a dynamic web page, everything revolves around the users input, so knowing how to ask for and collect this data is essential to any developer. This article is a basic tutorial on how to user HTML Forms, the most common method of data collection. ...
0
8159
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
8314
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
7922
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
6571
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5689
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5366
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...
0
3811
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3836
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1147
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.