473,394 Members | 1,640 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,394 software developers and data experts.

Insert Record Problems w/ Tab Control

I have a read-only form that allows the user to browse clients. There
are buttons on the form that allow the user to 'Add New' or 'Edit Existing'.

They both lead to the same form: frmClient

frmClient has a single hidden field (ClientId), and a tab control with
several pages. Each page holds a subform that lists respectively client
details, invoices, payments, notes, etc. It is designed to only view 1
client at a time, ie - no scrolling through records on this form. That
can only be done on the form that calls it.

The 'Edit Existing' works fine with the commands

strID = CStr(Me!fsubClientBrowse.Form![ClientID])
strLinkCriteria = "[ClientId]=" & strID
DoCmd.OpenForm "frmClient", , , strLinkCriteria

However, I can't seem to get 'Add New' to function correctly. I am trying:

DoCmd.OpenForm "frmClient"
set frm = Forms!frmClient
frm.AllowAdditions = True
DoCmd.GoTorecord ,,acNewRec
frm.AllowAdditions = false

This creates a new record in the first page of the tab control, but not
on frmClient itself, which is sitting on the first record in tblClient,
and to which all the subsequent pages link to.

I can't create a new record and then snag the autoId and THEN open the
form, because there are required fields for the record that also do not
have defaults.

Suggestions?

Nov 13 '05 #1
3 2287
HateSpam wrote:
I have a read-only form that allows the user to browse clients. There
are buttons on the form that allow the user to 'Add New' or 'Edit
Existing'.

[snip]


Is there anyone who can help with this? Should I state the problem in a
different way?

Nov 13 '05 #2
HateSpam <Ha******@nospam.com> wrote in
news:wz********************@fe2.columbus.rr.com:
HateSpam wrote:
I have a read-only form that allows the user to browse
clients. There are buttons on the form that allow the user
to 'Add New' or 'Edit Existing'.

[snip]


Is there anyone who can help with this? Should I state the
problem in a different way?

Teranews seems to have lost my original reply, so again
just
DoCmd.openForm "frmClient",,,,acFormAdd

--
Bob Quintal

PA is y I've altered my email address.
Nov 13 '05 #3
HateSpam <Ha******@nospam.com> wrote in message news:<2b*******************@fe2.columbus.rr.com>.. .
I have a read-only form that allows the user to browse clients. There
are buttons on the form that allow the user to 'Add New' or 'Edit Existing'.

They both lead to the same form: frmClient

frmClient has a single hidden field (ClientId), and a tab control with
several pages. Each page holds a subform that lists respectively client
details, invoices, payments, notes, etc. It is designed to only view 1
client at a time, ie - no scrolling through records on this form. That
can only be done on the form that calls it.

The 'Edit Existing' works fine with the commands

strID = CStr(Me!fsubClientBrowse.Form![ClientID])
strLinkCriteria = "[ClientId]=" & strID
DoCmd.OpenForm "frmClient", , , strLinkCriteria

However, I can't seem to get 'Add New' to function correctly. I am trying:

DoCmd.OpenForm "frmClient"
set frm = Forms!frmClient
frm.AllowAdditions = True
DoCmd.GoTorecord ,,acNewRec
frm.AllowAdditions = false

This creates a new record in the first page of the tab control, but not
on frmClient itself, which is sitting on the first record in tblClient,
and to which all the subsequent pages link to.

I can't create a new record and then snag the autoId and THEN open the
form, because there are required fields for the record that also do not
have defaults.

Suggestions?


I think before we go any further it's important to know how you get
the other required fields into your client record. You will have to
create your client record before you can create any related records in
other tables. Your best bet is probably to use two separate forms,
one for entering the required client information and one for the 'edit
existing' functionality. Once the user has successfully created a new
client record then he/she could be automatically sent into the 'edit
existing' function.

Bruce
Nov 13 '05 #4

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

Similar topics

14
by: serge | last post by:
I have a scenario where two tables are in a One-to-Many relationship and I need to move the data from the Many table to the One table so that it becomes a One-to-One relationship. I need to...
8
by: Carl | last post by:
Hi, I hope someone can share some of their professional advice and help me out with my embarissing problem concerning an Access INSERT query. I have never attempted to create a table with...
1
by: Abareblue | last post by:
I have no clue on how to insert a record into access. here is the whole thing using System; using System.Drawing; using System.Collections; using System.ComponentModel;
4
by: authorking | last post by:
I use the following code to insert a data record in to a datatable of an access database.But every time I execute the command, there will rise an exception and the insert operation can't be...
1
by: JayD | last post by:
Here is the problem: Using asp.net 2.0 to create a web app with standard master table gridview and child detailsview with insert capability. SQL Server 2000 database on the backend. Using Visual...
5
by: Brad Baker | last post by:
I'm trying to write a simple asp.net page which updates some data in a SQL database. At the top of the page I have the following code: <%@ Page Language="C#" Debug="true" %> <%@ import...
1
by: tcc.se7en | last post by:
Hi -- I have an ASP.NET web app that I just converted to use a Master Page for common content (banner and nav). I also just updated my version of the MS Ajax framework to the latest one (and had...
5
by: =?Utf-8?B?bXBhaW5l?= | last post by:
Hello, I am completely lost as to why I can't update a DropDownList inside a DetailsView after I perform an insert into an object datasource. I tried to simply it down to the core demostration:...
3
by: deneushasler | last post by:
Hello my name is Juan Jose. My problem is as follows. When I try to insert a record into a table (access) to control DetailsView Visual Web Developer 2005, when I run the page and insert a record...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...
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
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...

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.