Home » Developer & Programmer » Forms » Transforming a data block into a control block without doing it one by one
Transforming a data block into a control block without doing it one by one [message #209192] Wed, 13 December 2006 12:41 Go to next message
rizados
Messages: 8
Registered: December 2006
Junior Member
Okay, this morning I discovered I had a little problem.

I currently have a form with three tabs. The first tab accesses one table, the second tab accesses the same table plus another table, and the third tab accesses yet another table plus the second table. This is resulting in me running into the infamous "cannot reserve record (2 tries)" error.

Right now my data blocks are as follows:

block_I (being used in tab 1)
block_I1 (being used in tab 2)
block_C (being used in tab 2)
block_C1 (being used in tab 3)
block_W (being used in tab 3)

block_I and block_I1 are both accessing the I table.
block_C and block_C1 are both accessing the C table.

From what I can see from looking it up, I'm getting the "cannot reserve record" error because I've got two blocks accessing the same table (twice in this case).

How can I create fields using the same table, without doubling up on the data blocks? Can I create a control block that accesses the appropriate data block? Or can I convert the existing second data block to a control block and link it to the first data block?

I'm relatively new to forms, so I'm kind of learning most of this as trial by fire... The previous owner of this project had been doing this for five years, I haven't even been doing this for five months.

Thanks in advance,
Cyd
Re: Transforming a data block into a control block without doing it one by one [message #209247 is a reply to message #209192] Wed, 13 December 2006 23:23 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Quote:
The previous owner of this project had been doing this for five years, I haven't even been doing this for five months.


Is this form one of your's or the previous owner's?

I understand what you have written. What I want to know is what are you trying to achieve? I need to know if the I1 and C1 items are for display purposes or do you wish to update them?

Also, is there any relationship between the data on tab 1, tab 2, and tab 3. I know that they use the same database tables but when you go from tab 1 to tab 2 are you expecting a certain set of records to be displayed. The same question for tab 2 to tab 3.

David

[Updated on: Wed, 13 December 2006 23:25]

Report message to a moderator

Re: Transforming a data block into a control block without doing it one by one [message #209380 is a reply to message #209247] Thu, 14 December 2006 08:28 Go to previous messageGo to next message
rizados
Messages: 8
Registered: December 2006
Junior Member
djmartin wrote on Thu, 14 December 2006 00:23
Quote:
The previous owner of this project had been doing this for five years, I haven't even been doing this for five months.


Is this form one of yours or the previous owner's?



Previous owner's. I was supposed to be here for CF/ASP, but the Forms person left and the ASP person didn't. Go fig. I was willing to learn Forms, but I haven't been trained in it. Yet. We're working on that.

djmartin wrote on Thu, 14 December 2006 00:23

I understand what you have written. What I want to know is what are you trying to achieve? I need to know if the I1 and C1 items are for display purposes or do you wish to update them?


Display purposes for C1, update for I1. Tab 3 is display only, Tab 2 is query and update both, Tab 1 is query and update.

djmartin wrote on Thu, 14 December 2006 00:23

Also, is there any relationship between the data on tab 1, tab 2, and tab 3. I know that they use the same database tables but when you go from tab 1 to tab 2 are you expecting a certain set of records to be displayed. The same question for tab 2 to tab 3.

David



Some of the fields in Tab 1 (and the primary key) are the same as some of the fields in Tab 2. Tab 1 has some fields that Tab 2 does not have, and vice versa. The record displayed in Tab 1 should be the same record displayed when you get to Tab 2. Tab 3 is a summary of all of the completed records, using the same primary key (Table W and Table I have some equivalent fields, but Table W has a few extra fields that are not in Table I and vice versa. Table W is a table that can only take inserts from an ASP application, and is query only as far as the Form is concerned. Said data is then duplicated in Table I, additional information is added in the extra columns in Table I, and Table I is editable by Tab 1 and Tab 2. Tab 1 and Tab 2 are restricted as to who can edit which Tab. Those people who can edit Tab 2 can edit Tab 1, but not all people who can edit Tab 1 can edit Tab 2).

The same record displayed in Tab 1 is the record displayed in Tab 2. ALL of the records are displayed in Tab 3.

Block_C and Block_C1 call up the identical columns, only it only calls up 1 record in Tab 2, and calls up multiple records in Tab 3.

Block_I and Block_I1 call up some of the same columns, but not all of the columns in Block_I are in Block_I1, and vice versa.

Thank you for your help!

Cyd
Re: Transforming a data block into a control block without doing it one by one [message #209391 is a reply to message #209247] Thu, 14 December 2006 09:08 Go to previous messageGo to next message
rizados
Messages: 8
Registered: December 2006
Junior Member
djmartin wrote on Thu, 14 December 2006 00:23
Quote:
The previous owner of this project had been doing this for five years, I haven't even been doing this for five months.


Is this form one of your's or the previous owner's?

David


I should specify this a little further.

This is something that the previous owner wrote before she left, but it never got past the quick demo stage, it was never thoroughly completed.

In between the time she left and now, someone else refreshed the development database (we've got four people with access to the database here), and apparently wiped out some of the changes that she made to the dev database. I've been trying to re-engineer what she did to begin with.

Cyd
Re: Transforming a data block into a control block without doing it one by one [message #209778 is a reply to message #209391] Sun, 17 December 2006 20:14 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
If the form compiles then I assume that any changes that were made to the database are minor - a couple of new fields that hadn't been added to the form?

The easiest and crudest solution is to either 'commit' or 'post' the changes when you go to another tab.

David
Re: Transforming a data block into a control block without doing it one by one [message #209955 is a reply to message #209778] Mon, 18 December 2006 12:06 Go to previous messageGo to next message
rizados
Messages: 8
Registered: December 2006
Junior Member
It compiles *now* because I already did enough re-engineering to make it do so.

I'm not sure how she got away with having the previous one not do a commit before each tab change, but it works with that as a bit of a "hack".

Wish there were a more elegant solution for this.
Re: Transforming a data block into a control block without doing it one by one [message #209990 is a reply to message #209955] Mon, 18 December 2006 19:57 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
What sort of 're-engineering' did you do? Did you add any new blocks?

David
Re: Transforming a data block into a control block without doing it one by one [message #210125 is a reply to message #209990] Tue, 19 December 2006 08:50 Go to previous messageGo to next message
rizados
Messages: 8
Registered: December 2006
Junior Member
No new blocks, but I did add new database columns. Same tables, but additional columns. I got the feeling that she had added them previously (the code implied the columns existed, and there were database fields within blocks that didn't exist in the database), and when they refreshed the dev database, they wiped them out.

Cyd
Re: Transforming a data block into a control block without doing it one by one [message #210208 is a reply to message #210125] Tue, 19 December 2006 18:51 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
I agree with your actions.

David
Previous Topic: problem with LOV..............
Next Topic: Why Modal window closes?
Goto Forum:
  


Current Time: Fri Sep 20 15:38:13 CDT 2024