473,396 Members | 2,030 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Data Entry Form

I have a form (Prospect) with a subform (Document).

The result I am looking for is this:

The user selects a prospect which is made up of Prospect Name, Country,
Company and Prospect Type. They can then use the subform to add records
into the database with the above information already there.
At the moment I have four combo boxes in the Prospect part of the form.
The user can use the combo boxes to select a prospect. The document
subform has the "data entry" property enabled so the user enters
document names and locations.

The problem is that rather than inserting each document under prospect
names which already exist, Access is creating a new propsect (with the
same name but different ID) and filing them under that.

How can I use the combo boxes to navigate to a particular prospect
record (an add prospect feature is not required), and have access put
the documents inserted in the subform into this?

Here is a screenshot of the form if it will help:
http://img35.exs.cx/img35/9764/eg1.jpg

Thanks
Ed

Nov 13 '05 #1
1 2299
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I suggest that you set up your form in 2 sections:

Header section - search section.

Detail section - Prospect record section and Document subform (keep your
current set up).

In the Header section put the Combo Boxes that define the Prospect
search. These Combo Boxes are UNBOUND controls (that means their
ControlSource property is empty) - be sure these controls have different
names than those controls in the Detail section. Use the same RowSource
values that you are using for the ComboBoxes in the Detail section.
Place a CommandButton in the Header section that initiates the search
after all the criteria has been selected/entered in the search Combo
Boxes.

The CommandButton OnClick event is set up to change the WHERE clause of
an SQL statement. The WHERE clause is created by reading the values of
the header section ComboBoxes. E.g.:

Private Sub cmdSearch_Click()

const SQL = "SELECT * FROM table_name WHERE "

dim strWhere as string

If Not IsNull(Me!cboCountry) Then
' value in Country ComboBox is string & requires delimiters
strWhere = "Country = '" & Me!cboCountry & "' "
End If

If Not IsNull(Me!cboProspectType) Then
If Len(strWhere)>0 Then strWhere = strWhere & " AND "
' value in ProspectType ComboBox is number
strWhere = "ProspectType = " & Me!cboProspectType
End If

' ... other search criteria controls are parsed

' Put the new SQL string in the form's RecordSource property
Me.RecordSource = SQL & strWhere

' You don't need to requery the form: putting a value in the
' RecordSource propery automatically requeries the form.

End Sub

You should put in error traps/handler code and other criteria controls
as needed.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQUhokIechKqOuFEgEQLcCgCgoRLK2sCnrVFGkj0URIB56Y/FLfQAnjuL
LG/0Kc8dBx0HVtvAPXR1ZgLT
=GT3s
-----END PGP SIGNATURE-----
ed*******@gmail.com wrote:
I have a form (Prospect) with a subform (Document).

The result I am looking for is this:

The user selects a prospect which is made up of Prospect Name, Country,
Company and Prospect Type. They can then use the subform to add records
into the database with the above information already there.
At the moment I have four combo boxes in the Prospect part of the form.
The user can use the combo boxes to select a prospect. The document
subform has the "data entry" property enabled so the user enters
document names and locations.

The problem is that rather than inserting each document under prospect
names which already exist, Access is creating a new propsect (with the
same name but different ID) and filing them under that.

How can I use the combo boxes to navigate to a particular prospect
record (an add prospect feature is not required), and have access put
the documents inserted in the subform into this?

Here is a screenshot of the form if it will help:
http://img35.exs.cx/img35/9764/eg1.jpg


Nov 13 '05 #2

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

Similar topics

2
by: Iain Miller | last post by:
Struggling a bit here & would be grateful for any help. I have a table which has a list of people in it. Each person has a unique ID automatically allocated by Access but also belongs to one of 5...
0
by: tamilan71 | last post by:
Can anyone tell me a simple method of creating an application in Access 2003 that uses "Double data entry"? For me double data entry is defined as the ability to have data entered twice. The first...
2
by: filbennett | last post by:
Hi Everyone, I'm generally unfamiliar with Access form design, but have programmed Cold Fusion applications for a couple of years. I'd like to build a data entry form in Access that allows the...
2
by: x | last post by:
hi i am a pilot by profession. i want to create a database of my logbook using ms access 2002. i am facing a problem regarding the format of time field. when i select "Data/Time" data type for my...
2
by: Sethos | last post by:
I am sure that this has been covered, hashed, and rehashed, but a search on the group did not produce the answer, so forgive me if this seems like a "newbie" type question... Besically, I have a...
6
by: Brian Blair | last post by:
I have created a input form that enters a number in a talble. If I open the form again it enters a new record instead of editing the existing record. It seems like it should be very basic but I...
3
by: bosmatthews | last post by:
I have a main form with a subform and a second subform nested to the first subform. The data entry property for all three forms (main, subform and sub-subform) is set to "yes" because I am intending...
20
by: hippomedon | last post by:
Hello everyone, I'm looking for some advice on whether I should break the normalization rule. Normally, I would not consider it, but this seems to be a special case. I have created an...
1
by: Data Entry Outsourcing | last post by:
Data Entry plays vital role in every business area. Data Entry is one such aspects of any business that needs to be handled properly for expanding your business. Data Entry is one of the leading...
0
by: Tyler | last post by:
Made a data entry form which is a subform. I made a continuous form that displays everything entered through the data entry form. The data entry form displays all of the records. This doesn't...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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...
0
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...

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.