473,804 Members | 2,145 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

complex form operations?

AccessIdiot
493 Contributor
Please forgive as I am an Access and VB newbie.

For what it's worth, here is my complete setup. Maybe it will help or maybe it will just confuse but I'll outline it anyway.

I have a main form that has 3 buttons. Each button opens the same form (frm_Survey) but passes a different string to the form. When a button is clicked the main form is closed to prevent the user from pressing another button. The form that is opened is frm_Survey. The string that is passed from the button via OpenArgs is concatenated with an integer that the user enters in an unbound textbox on frm_Survey and that value is put in the table (tbl_Survey) and also populates a disabled field (txt_SuveyNumID ).

So for example, the user hits the "Trawl" on the main form. The main form closes, frm_Survey opens, and 'TR' is passed to frm_Survey. On frm_Survey the user types in "2" and in txt_SurveyNumID you would see "TR2" which also gets entered into SurveyNum field of tbl_SurveyNum.

There is a button on frm_Survey that launches frm_Replicate. The concatenated field from frm_Survey (txt_SurveyNumI D) should also show up on frm_Replicate (getting passed by OpenArgs) and be entered into the table that feeds frm_Replicate (tbl_Replicate - they are linked by a one to many relationship: one survey can have many replicates).

There is a button on frm_Replicate that adds a new record (New Replicate). The user should be able to add as many records as they like, keeping that concatenated field that was passed from frm_Survey (txt_SurveyNumI D). When they are done, they should be able to click on a New Survey button that closes frm_Replicate and return to frm_Survey. Now the user can change the number in the integer field, which is concatenated with the string passed from the main form, click a button to open frm_Replicate again, and start over with the new concatenated value.

In other words, "New Survey" button closes frm_Replicate. Type "3" into the field on frm_Survey and you should now see "TR3". Hit "New Replicate" and frm_Replicate opens with "TR3" as Survey_Num.

I hope this isn't too confusing. If it would help to draw a picture I can do that if you tell me how to upload attachments.

Now here are my problems:

1) When I hit "New Replicate" button on frm_Replicate it doesn't advance to a new record. I get an error message: "Can't go to specified record". This is the code on the button:
Expand|Select|Wrap|Line Numbers
  1. Private Sub btnNewReplicate_Click()
  2. On Error GoTo Err_btnNewReplicate_Click
  3.  
  4.     DoCmd.GoToRecord , , acNewRec
  5.  
  6. Exit_btnNewReplicate_Click:
  7.     Exit Sub
  8.  
  9. Err_btnNewReplicate_Click:
  10.     MsgBox Err.Description
  11.     Resume Exit_btnNewReplicate_Click
  12.  
  13. End Sub
2) When I click on "New Survey" frm_Replicate closes like it should, but I need the data that is currently on the frm_Survey to get entered into the table and then advance to a new record so I can change the Survey_Num. How do I do this? Right now if I change the integer and go to a New Replicate then whatever was last in the field is what is getting entered. In other words, if first it is TR2 and then I go back and change it to TR3 then only TR3 is going into the database. I think I need some kind of Requery somewhere? Maybe on the button on frm_Replicate that goes back to frm_Survey (New Survey)?

I have all sorts of code snippets that I can provide as well if that would help.

Thanks in advance and sorry for the long post!!

cheers,
melissa
Mar 14 '07 #1
8 2466
Rabbit
12,516 Recognized Expert Moderator MVP
Rather than a new form, could I suggest a continuous subform on frm_survey? If you link the master and child fields the foreign key will transfer automatically.
Mar 17 '07 #2
AccessIdiot
493 Contributor
Thanks for your response, I'm trying this now.

Cheers!
Mar 19 '07 #3
Rabbit
12,516 Recognized Expert Moderator MVP
Good Luck, let us know how you get along. If you get this working correctly, you can hide the field on the subform altogether so they won't be able to change it.

Also, if you set up the relationship to cascade updates and cascade deletes, then whenever they delete or change the primary key value for a record, it updates to the linked table. And if they delete a primary key value, it deletes all records in the linked tables with the same foreign key value.
Mar 19 '07 #4
NeoPa
32,579 Recognized Expert Moderator MVP
I would certainly support that advice (about the cascading updates/deletes) Melissa.
Can you let us know if this question is still current. From your other thread I feel this may have been superceded?
Mar 20 '07 #5
AccessIdiot
493 Contributor
I've got things working with a subform and form. I'd link to learn more about cascading as you suggested but I'm going to post in the other thread I started about locking/disabling as it is more pertinent there.

Thanks for your help!
Mar 20 '07 #6
NeoPa
32,579 Recognized Expert Moderator MVP
Can you post a link in here to your other thread then, so I can check it out.
Mar 20 '07 #7
Rabbit
12,516 Recognized Expert Moderator MVP
The thread is here.
Mar 20 '07 #8
NeoPa
32,579 Recognized Expert Moderator MVP
Thanks Rabbit. Top man.
Mar 20 '07 #9

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

Similar topics

3
1699
by: Peter Olsen | last post by:
I want to define a class "point" as a subclass of complex. When I create an instance sample = point(<arglist>) I want "sample" to "be" a complex number, but with its real and imaginary parts computed in point()'s __init__ function with their values based on the arglist. I want to compute with point instances as though they were native complex numbers, but I want to be able to
2
1022
by: WATYF | last post by:
Hello. I have a multi-threaded app that has a few different Timers all of which deserialize and serialize objects to perform certain operations. At the same time, the user can be working in the app and making changes (thus deserializing and serializing objects, as well). I'm sure you can see my problem. Currently, I'm using binary serialization and hashtables to persist the state of an entire form (including listview items/subitems,...
12
2769
by: vj | last post by:
Hi! I have a piece of code (shown below) involving complex numbers. The code is not running and giving error ("Invalid floating point operation" and "SQRT:Domain error"). I would be very thankful if someone can tell me where is the problem. I am aware that my code is far from being efficient and organized, and also there are many extra #include statements not really required for the code. I am a novice programmer, as you can see ! At...
17
3739
by: Julian V. Noble | last post by:
Dear C Mavens, I am writing a Computing Prescription for CiSE on complex arithmetic. I would like to be sure that I do not include any gaffes about C99--especially about what is in the header file <complex.h. I have Googled <complex.hand got about 177K hits, which I obviously do not wish to go through one at a time. I also tried "<complex.hsource" but still got Does anyone know where I can get a complete, definitive and
3
3555
by: Klaas Vantournhout | last post by:
Hi, I am using CLAPACK to do lots of matrix operations, but this is done on complex matrices. There I also need to work with normal complex operators, I use also the standard complex library. Unfortunately this one conflicts with some stuff in f2c.h needed to run CLAPACK. Examples are that f2c.h declares a variable complex that fights with everything from the standard complex header. Most errors I got rid of by dumping all the...
2
3299
by: polocar | last post by:
Hi, suppose that you have a C# form with two buttons, that are the classical "btnOk" and "btnCancel" (besides them, of course in the form there can be many other controls). When the user clicks on btnOk, the program makes some confirm operations and closes the form. When the user clicks on btnCancel, the program makes some cancel operations and closes the form. My problem is that, when the user clicks on the "X" button of the form...
14
2434
by: David Marsh | last post by:
Can someone show me or point me to an example of declaring and initializing complex numbers in C99? Also, in looking at complex.h, I don't see any library calls for + - * or /. How are the basic arithmetic operations carried out? David Marsh
27
2596
by: David Marsh | last post by:
I understand that C99 supports a complex type and complex arithmetic. There is nothing about it in the FAQ and online searches turned up very little except synopses. Can anyone point me toward sources or give examples which show how to: -declare a complex variable -assign the real and imaginary parts -perform the basic +,-,*,/ operations on complex numbers Thanks,
4
1454
by: BiDi | last post by:
I have been trying to subclass complex, but I am not able to get the right-hand arithmetic operators working. As shown below, if an object of my subclass 'xcomplex' is added on the right of a 'comlex' object, the type returned is 'complex', not 'xcomplex'. I've tried subclassing float and it works fine (don't even need to define __coerce__ in that case)
0
9715
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9595
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10356
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
9176
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7643
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5536
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4314
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 we have to send another system
2
3836
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3003
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.