473,503 Members | 939 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Carry over values to next record in a form

194 New Member
Hi everybody,

I want to carry over last values of a record to the next record on ms access form. I'm using the Allen Browne's following method:

http://allenbrowne.com/ser-24.html

but its not working. please tell me what should I do?
Sep 15 '09 #1
8 5982
NeoPa
32,557 Recognized Expert Moderator MVP
I suggest you start by telling us exactly what you're doing and exactly what goes wrong (please include error message) and where.
Sep 15 '09 #2
mfaisalwarraich
194 New Member
Thanx for reply.

I have two tables named mainTable and named student table. In the mainTable i have RNO (Integer), LEC(Integer) and dated(medium date) fields. Whereas in the student table have student names with their roll numbers.

In the mainTable RNO datatype is a lookup value (combo box) from Student table and LEC also has its datatype as lookup value (combo box) from some other table. The dated filed in the mainTable do not relates to field and it needs to be entered each and every time. I want to avoid entering values again and again for each student like date and lec. i just want to select the RNO (which is roll number) and the other values will be selected as entered previously (last record in the mainTable).

I am not receiving any error while deploying Allen Browne's method. But the method is not working.

I hope the above explanation would serve ur purpose and you will help me accordingly. Thanking you.
Sep 15 '09 #3
ChipR
1,287 Recognized Expert Top Contributor
You'll have to show us the code you are using in the BeforeUpdate event of your form.
Sep 15 '09 #4
mfaisalwarraich
194 New Member
here is the code which im using on the Before Insert event of the form as written in the instructions of the method:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub Form_BeforeInsert(Cancel As Integer)
  3.         Dim strMsg As String
  4.         Call CarryOver(Me, strMsg)
  5.         If strMsg <> vbNullString Then
  6.             MsgBox strMsg, vbInformation
  7.         End If
  8.     End Sub
  9.  
  10.  
Sep 15 '09 #5
ChipR
1,287 Recognized Expert Top Contributor
Let's check and see what the default value of some controls are at the end of the function. Use the debugger or a MsgBox to stop the code at the End If line and check some control .DefaultValue properties. You can print them in debug, or put in
Expand|Select|Wrap|Line Numbers
  1. MsgBox aControl.DefaultValue
Then we'll know whether the default value is being saved properly before going to the next record.
Sep 15 '09 #6
NeoPa
32,557 Recognized Expert Moderator MVP
For more about debugging see Debugging in VBA.

PS. I noticed you posted the BeforeInsert event procedure instead of the BeforeUpdate one. Was there any reason for that?
Sep 15 '09 #7
mfaisalwarraich
194 New Member
thanx chipr and neopa.

as i already mentioned dat the instructions at the allen browne's site asked me to paste it at BeforeInsert event instead of BeforeUpdate. But the code is not working at any event.

Am not very much familiar with the VBA Debugging. Please tell me how i can debug this error as there are no error messages im having while running the form.

As neopa gave me a link and i studied dat link. i dont know where the watch pane will come as there is no watch pane in the debugging window dat i can see. please help me to get rid of this problem.

thanx alot.
Sep 16 '09 #8
NeoPa
32,557 Recognized Expert Moderator MVP
@mfaisalwarraich
I may have to update the article. I thought I had everything covered.

Anyway, all panes are viewable from the View menu. A shortcut for the Watch Pane is Alt-V+H. I'm sure using debug will be a great help to you going forward.
Sep 16 '09 #9

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

Similar topics

1
1754
by: David | last post by:
Hi, I have an ASP page with a form and the following code: ..... type=Radio Checked name=selectserial value=" & RS("PSL_F_Serial")..... Tis will carry over the value of RS("PSL_F_Serial"),...
2
4660
by: kma | last post by:
I am designing an Access 2000 database on a computer running Windows 98. I have one form with several tabs; all of which have sub forms, some with a subform on a subform. For example, on my...
2
8972
by: Almir | last post by:
I have a simple problem, i just can get a grasp on it. I designed a database for inventory of computer equipment. Now i created forms for each table. Each piece of equipment is going to come in an...
2
2980
by: Paul Malcomson | last post by:
Hi. I'm having terrible trouble with a form that displays several parent/child relationships at one time. It is a sales force hierarchy - Sales force, district, territory, sales rep are the...
7
2203
by: John | last post by:
Hi, I'm sure this has been asked and answered before but I lost it. How does one code a form to carry forward the only certain fields from the previous record. Thanks.
7
2571
by: Dave Hopper | last post by:
Hi I posted a question recently regarding problems I am having getting a value from a list box to use in a query. I got a lot of help, for which I thank you and it's nearly working! But I need...
4
3201
by: JohnR | last post by:
Hi, I'm trying to update a DBF file which I'm using VB.NET ODBC adapters, commands and connections. I fill the dataset and databind the columns to textboxes on my form. I can successfully view,...
5
3927
by: campbellbrian2001 | last post by:
I'm trying to get the "Carry data over to new record" code to work from Allen Browne's site: http://allenbrowne.com/ser-24.html I follwed the instruction explicitly and somethings not working......
2
4238
rsmccli
by: rsmccli | last post by:
Access 2002 Hi, I have a number of comboboxes/textboxes in the header of a form that the user selects values from. These comboboxes/textboxes correspond to controls in a datasheet view subform....
0
7089
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
7282
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
7339
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...
1
6995
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
7463
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...
0
5581
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,...
0
3168
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...
0
1515
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
738
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.