A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Listbox w/subforms



 
 
Thread Tools Display Modes
  #1  
Old May 6th, 2008, 04:30 AM posted to microsoft.public.access.forms
Ernst Guckel
external usenet poster
 
Posts: 50
Default Listbox w/subforms

Hi,

I have a main form frmEmp and a subform sfrmEmpGeneral. They are linked
via EmpID from tblEmployees. Both forms contain data from tblEmployees. On
the main form i have a listbox that alows me to select the current employee.
There are two problems that I cannot get past...

1. I cannot update data on the subform without getting the error "Data has
been Changed" Another user has eddited this record ... but once I get this
error I can continue and the data change is saved.

2. I cannot create a new record. Not even sure how. I have created a 'New
record' button but the code gives me a blank record but It does not work
right. EmpID is an autonumber field but it does not generate a new number.

I am at a loss. The allow edits and allow additions are enabled.

Any ideas let me know,
Ernst.

  #2  
Old May 6th, 2008, 06:08 AM posted to microsoft.public.access.forms
Jim Bunton[_2_]
external usenet poster
 
Posts: 52
Default Listbox w/subforms

The concept of a sub form is generally applicable to the situation where you
want to "link" information that is in two tables (not one). An example might
be an invoice (one table) and the items on the invoice (another table)

[eg Invoices - invoiceId, invoice date InvoiceItems InvoiceItemId,
InvoiceId, ItemDescription, ItemCost.] These would llink on InvoiceId. The
main Form would be a single record form and the subform mulitiple records.

In the case you are describing:
There ar two options (at least!)
1. Use two forms - one for 'Basic' information and anothe for 'detailed'
information
[you could open the second from the first BUT don't allow edits of the
same information on each form or you will likely get the same 'error' as you
are getting now]
2. Put all the information on one form - then, write some code to 'collapse'
the more detailed information [make the controls have zero size and move
them and make them invisible and while you are doing this have in mind the
code to resize them and move them to the original positions and make them
visible - which you can put into the click event for a button on the always
visible part of the form.

Jim Bunton

"Ernst Guckel" wrote in message
...
Hi,

I have a main form frmEmp and a subform sfrmEmpGeneral. They are linked
via EmpID from tblEmployees. Both forms contain data from tblEmployees.
On
the main form i have a listbox that alows me to select the current
employee.
There are two problems that I cannot get past...

1. I cannot update data on the subform without getting the error "Data
has
been Changed" Another user has eddited this record ... but once I get
this
error I can continue and the data change is saved.

2. I cannot create a new record. Not even sure how. I have created a
'New
record' button but the code gives me a blank record but It does not work
right. EmpID is an autonumber field but it does not generate a new
number.

I am at a loss. The allow edits and allow additions are enabled.

Any ideas let me know,
Ernst.



  #3  
Old May 6th, 2008, 07:24 AM posted to microsoft.public.access.forms
Jason[_25_]
external usenet poster
 
Posts: 126
Default Listbox w/subforms

I've used tabed pages to make things easier ( the tabs can contain fields of
the same table or they can contain subforms)
"Jim Bunton" wrote in message
...
The concept of a sub form is generally applicable to the situation where

you
want to "link" information that is in two tables (not one). An example

might
be an invoice (one table) and the items on the invoice (another table)

[eg Invoices - invoiceId, invoice date InvoiceItems InvoiceItemId,
InvoiceId, ItemDescription, ItemCost.] These would llink on InvoiceId. The
main Form would be a single record form and the subform mulitiple records.

In the case you are describing:
There ar two options (at least!)
1. Use two forms - one for 'Basic' information and anothe for 'detailed'
information
[you could open the second from the first BUT don't allow edits of the
same information on each form or you will likely get the same 'error' as

you
are getting now]
2. Put all the information on one form - then, write some code to

'collapse'
the more detailed information [make the controls have zero size and move
them and make them invisible and while you are doing this have in mind the
code to resize them and move them to the original positions and make them
visible - which you can put into the click event for a button on the

always
visible part of the form.

Jim Bunton

"Ernst Guckel" wrote in message
...
Hi,

I have a main form frmEmp and a subform sfrmEmpGeneral. They are

linked
via EmpID from tblEmployees. Both forms contain data from tblEmployees.
On
the main form i have a listbox that alows me to select the current
employee.
There are two problems that I cannot get past...

1. I cannot update data on the subform without getting the error "Data
has
been Changed" Another user has eddited this record ... but once I get
this
error I can continue and the data change is saved.

2. I cannot create a new record. Not even sure how. I have created a
'New
record' button but the code gives me a blank record but It does not work
right. EmpID is an autonumber field but it does not generate a new
number.

I am at a loss. The allow edits and allow additions are enabled.

Any ideas let me know,
Ernst.





  #4  
Old May 6th, 2008, 01:36 PM posted to microsoft.public.access.forms
Ernst Guckel
external usenet poster
 
Posts: 50
Default Listbox w/subforms


Really what I want to do is design a tab control without using the tab
control. The one built into access is limited. I have 5 command buttons and
five subforms. I then change the source object of a subform control. I
could solve the problem by having them not linked to the main form in anyway
but act like main forms in their own right. The problem is the listbox.
When you select an employee in the listbox I want to change the employee in
the subform.

Ernst.

"Jason" wrote:

I've used tabed pages to make things easier ( the tabs can contain fields of
the same table or they can contain subforms)
"Jim Bunton" wrote in message
...
The concept of a sub form is generally applicable to the situation where

you
want to "link" information that is in two tables (not one). An example

might
be an invoice (one table) and the items on the invoice (another table)

[eg Invoices - invoiceId, invoice date InvoiceItems InvoiceItemId,
InvoiceId, ItemDescription, ItemCost.] These would llink on InvoiceId. The
main Form would be a single record form and the subform mulitiple records.

In the case you are describing:
There ar two options (at least!)
1. Use two forms - one for 'Basic' information and anothe for 'detailed'
information
[you could open the second from the first BUT don't allow edits of the
same information on each form or you will likely get the same 'error' as

you
are getting now]
2. Put all the information on one form - then, write some code to

'collapse'
the more detailed information [make the controls have zero size and move
them and make them invisible and while you are doing this have in mind the
code to resize them and move them to the original positions and make them
visible - which you can put into the click event for a button on the

always
visible part of the form.

Jim Bunton

"Ernst Guckel" wrote in message
...
Hi,

I have a main form frmEmp and a subform sfrmEmpGeneral. They are

linked
via EmpID from tblEmployees. Both forms contain data from tblEmployees.
On
the main form i have a listbox that alows me to select the current
employee.
There are two problems that I cannot get past...

1. I cannot update data on the subform without getting the error "Data
has
been Changed" Another user has eddited this record ... but once I get
this
error I can continue and the data change is saved.

2. I cannot create a new record. Not even sure how. I have created a
'New
record' button but the code gives me a blank record but It does not work
right. EmpID is an autonumber field but it does not generate a new
number.

I am at a loss. The allow edits and allow additions are enabled.

Any ideas let me know,
Ernst.






 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:15 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.