473,324 Members | 2,179 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,324 software developers and data experts.

Accessing the New entry portion of an access form

Ok, so I have a Form. It is a continuous form.

In the header one selects what person to view data for. Once the
person is selected, the travel information that has been budgeted for
the year associated with that person appears below (this is a 3 table,
many to many: people travel to locations).

The final line of the continuous form is to add new data. I start
typing in the name of the destination, and it autocompletes the name
if it's there (if it's not, I'm planning on bringing it to the
attention of the user via dialog box and then adding it to the
location table if necessary, but I've not started on that yet). How
can I easily grab the primary key for that name and then set in the
new record. Where is that new record located?
tony
Nov 13 '05 #1
3 1503
Since the name is auto-completing, I'm assuming you're using a combo box. If
so, to bring in the PersonID, add a column to the combo box. In the Row
Source of the combo box, add the PersonID field to the query, this will add
the column. Increase the Column Count property by 1 and set the Bound Column
to the column that PersonID is in. This last step will cause the PersonID to
be stored in the form's table instead of the person's name. Set the Column
Widths property to 0 for the column that PersonID is in so that the user
doesn't see the ID field. Set Limit To List to Yes. Use the Not In List
event to add a new person to the Person table if the user enters someone who
isn't in the list.

--
Wayne Morgan
Microsoft Access MVP
"tony bergstrom" <mo******@hotmail.com> wrote in message
news:b9**************************@posting.google.c om...
Ok, so I have a Form. It is a continuous form.

In the header one selects what person to view data for. Once the
person is selected, the travel information that has been budgeted for
the year associated with that person appears below (this is a 3 table,
many to many: people travel to locations).

The final line of the continuous form is to add new data. I start
typing in the name of the destination, and it autocompletes the name
if it's there (if it's not, I'm planning on bringing it to the
attention of the user via dialog box and then adding it to the
location table if necessary, but I've not started on that yet). How
can I easily grab the primary key for that name and then set in the
new record. Where is that new record located?
tony

Nov 13 '05 #2
Using the personID is not a problem right now. When I said name
before, I meant to be referring to the name of the destination. It was
still the same idea though. Sorry, for the confusion.

Actually, it is a text box. Though, I tried changing it to a combo
box for the suggestion. It will not let me set "Limit to list" to no,
as long as the bound column (primary Key) is not visible (width = 0).

Will something along the lines of Me.Recordset.getLast or something
get me in the right place to access the incoming data?

It may be important to note, the names of the destination are not
unique. There may be multiple entries for different fiscal years with
different information.
tony

"Wayne Morgan" <co***************************@hotmail.com> wrote in message news:<Aj***********@newssvr33.news.prodigy.com>...
Since the name is auto-completing, I'm assuming you're using a combo box. If
so, to bring in the PersonID, add a column to the combo box. In the Row
Source of the combo box, add the PersonID field to the query, this will add
the column. Increase the Column Count property by 1 and set the Bound Column
to the column that PersonID is in. This last step will cause the PersonID to
be stored in the form's table instead of the person's name. Set the Column
Widths property to 0 for the column that PersonID is in so that the user
doesn't see the ID field. Set Limit To List to Yes. Use the Not In List
event to add a new person to the Person table if the user enters someone who
isn't in the list.

--
Wayne Morgan
Microsoft Access MVP
"tony bergstrom" <mo******@hotmail.com> wrote in message
news:b9**************************@posting.google.c om...
Ok, so I have a Form. It is a continuous form.

In the header one selects what person to view data for. Once the
person is selected, the travel information that has been budgeted for
the year associated with that person appears below (this is a 3 table,
many to many: people travel to locations).

The final line of the continuous form is to add new data. I start
typing in the name of the destination, and it autocompletes the name
if it's there (if it's not, I'm planning on bringing it to the
attention of the user via dialog box and then adding it to the
location table if necessary, but I've not started on that yet). How
can I easily grab the primary key for that name and then set in the
new record. Where is that new record located?
tony

Nov 13 '05 #3
I seem to have found something that works. On the Lost Focus event of
the field in question, Im just doing Me.Fieldname (where Fieldname is
the name of the field I want) and it seems to be returning the data of
whatever record is being worked on. From that, Im making a query in
vb to get the key.

I haven't gotten to the inserting part yet, just the getting and
checking of data
tony

mo******@hotmail.com (tony bergstrom) wrote in message news:<b9**************************@posting.google. com>...
Ok, so I have a Form. It is a continuous form.

In the header one selects what person to view data for. Once the
person is selected, the travel information that has been budgeted for
the year associated with that person appears below (this is a 3 table,
many to many: people travel to locations).

The final line of the continuous form is to add new data. I start
typing in the name of the destination, and it autocompletes the name
if it's there (if it's not, I'm planning on bringing it to the
attention of the user via dialog box and then adding it to the
location table if necessary, but I've not started on that yet). How
can I easily grab the primary key for that name and then set in the
new record. Where is that new record located?
tony

Nov 13 '05 #4

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

Similar topics

2
by: Suzanne Boyle | last post by:
I have some javascript code in my page that calls the document.getElementById method. This usually works fine however in IE 6, after I have downloaded a file using the File Download dialog, I get...
9
by: Swami | last post by:
I was wondering how I can programmatically find out the path of an installed program. I have an application that needs access to a config file that resides in the folder of another application. ...
1
by: Raffle | last post by:
Hi all, I'm still fairly new to Access and I was hoping to get some assistance with something I have yet to accomplish. The desired result is a form where users can enter data but for a few...
4
by: Sean Connery | last post by:
I have a Microsoft UI Process Application Block that is controlling child forms in an MDI parent container. The views node in the app.config file has been set to stayOpen=false. Because there...
1
by: CS Wong | last post by:
Hi, I have a page form where form elements are created dynamically using Javascript instead of programatically at the code-behind level. I have problems accessing the dynamically-created...
6
by: Bob Alston | last post by:
I am looking for Access reporting add-in that would be easy to use by end users. My key focus is on selection criteria. I am very happy with the Access report writer capabilities. As far as...
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...
4
by: raj_genius | last post by:
I hav two queries, whc are as follows: FIRSTLY: is it possible to access the controls(by name) of a parent form(MDI) from its child forms??if yes then how??plzz provide a coded example in VB if...
7
by: Chuck Anderson | last post by:
I'm pretty much a JavaScript novice. I'm good at learning by example and changing those examples to suit my needs. That said .... ..... I have some select fields in a form I created for a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.