data in table gets interchanged

meezadahsra

New member
Local time
Yesterday, 16:02
Joined
Jan 23, 2013
Messages
8
hello experts

i have created 6 tables and individual forms for each of them to fill those tables.
also i have reports which are bounded to 4 of these tables/forms.


my problem is this :

i have successfully filled the tables using these forms. but whenever i open it the next day or so, the data in some of the tables gets mixed up.

For eg:
>my EMPLOYEE DETAILS has the emp no as primary key, and is linked as lookup field in other tables. (so tht user may select emp no and then enter details in FORMS)
>my EMPLOYEE ADRESS table's (report not linked) data gets interchanged according to emp no.
instead of being 1,2,3,4,5,6 (as i entered), its 2,3,4,5,6,6.
>sometimes my other tables also have these problems.


is there a reason why this is happening ????

what could be the problem?

PLZ HELP !!!!
 
If you mean that the records are not displayed in the same sequence as the one in which you created them then that is correct. Tables do not have any built-in order. If you want things in some given sequence, then use a query in which you specify the ORDER BY clause. In Reports, specify the ORDER BY in that report property itself, since it is ignored in the record source.
 
no i dont mean that the records are not displayed in the same sequence as i created them.

what im trying to say is that the records are getting interchanged automatically.

for eg:
1 XXXX
2 abcd
3 wert
4 fghh
5 ghjk
6 iopt

is becomming

6 XXXX
2 abcd
3 wert
4 fghh
5 ghjk
6 iopt
or

2 XXXX
2 abcd
3 wert
4 fghh
5 ghjk
6 iopt

its happening for the primary key i.e EMP no

dont know why its happening....
 
Are you attempting to use a bound combo for searching?

If your form needs a search capability, you need separate, unbound combos or text boxes that are used only for searching. It sounds like users are changing the values of existing records by mistake. In some cases you might have to lock certain controls in existing records so that users cannot change them accidentally.
 
no i am not using a bound combo box for searching anything...infact im not searching any details....but it occurs to me, whenever i click on the EMP NO it doesnt show the details for tht specific emp no. instead it shows the details of the first epmloyee.

how do i get my db to show the details of the specific employee when the emp no is selected in the forms of all them tables??????
 
When you click on the combo, you are changing the value in the record you are looking at. You CANNOT use a bound combo to "find" a record.
 
ok so i cant use a bound combo to FIND a record. i get that. but how do i display the details of employee by selecting the emp number entered (i thought using a bound combo was the solution)??and how do i edit it at the same time (if the user wants to )???
 
If you want to display data from multiple tables on the same form - i.e. a main table and data from one or more lookup tables - you create a query that joins the tables. You will want to use left joins if the lookup fields are optional. Then for your form, you can select any columns from the query used as the RecordSource and bind them to controls. So, a typical example would be an order entry form. This type of form usually has columns you want to display only (customer name) and columns that might need to be changed but for which you want to get an original value (ship to address). For columns I only want to view on this form, I set the locked property to Yes. This prevents the user from accidentally updating the data. For something like the shipping address, in most cases, it will be the same as the billing address so in the AfterUpdate event of the CustomerID combo, I copy the billing address from the customer table to the shipping address of the order table.
Code:
Me.txtShipAddr = Me.BillAddr
Me.txtShipCity = Me.BillCity
Me.txtShipST = Me.BillST
Me.txtShipZip = Me.BillZip
Notice that there is no if statement involved. If you allow the customer to be changed, you should always copy in a new address even if it overlays the previous one. I generally allow fields in the order header to be changed until an order is shipped. Once it is shipped, I lock the fields and don't allow updates.
 

Users who are viewing this thread

Back
Top Bottom