Go to next (UNIQUE) record

Westside1st

New Member
Joined
Oct 17, 2022
Messages
9
Office Version
  1. 2016
Platform
  1. Windows
Hello experts

I'm having an issue solving this puzzle

I have a query which include linked tables
(please check the uploaded Image)

In the form I had a command button that had a VBA code On Click

DoCmd.GoToRecord , , acNext

My issue is that the REQ_NO field contain a duplicate records because of the linked table ... So when I go to next record by clicking the command button it shows me the same record details multiple time

for example :

I'm in record no. 12 when I click next it moves to 13 when I click next again it moves to 14 ... but when I'm in record 29 and I click next it moves to 29 and when I click next again it moves to 29 and I click next for the forth time then it moves to 30 .
And that because 29 is a three records in the query.

So is there a way to tell the access to move from 29 to 30 and from 30 to 31 without going through all the duplicated record ???

Thank you all
 

Attachments

  • Records.JPG
    Records.JPG
    52 KB · Views: 9

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Please show us your table design. What field/fields make records unique?
 
Upvote 0
Even if there is a unique field .... The problem is that I'm going to see duplicated information when I click next because every records linked to multiple tickets and every tickets having the same details but linked to one record which is duplicated.... Sorry about the confusion .


I still didn't figure out the FindFirst method yet but I'm trying.
 
Upvote 0
Post some data if you remain stuck and I'll take a crack at it - no pics of data please.
 
Upvote 0
Sorry for that ....
I tried to upload my database but the file is large for the server so I upload it on mediafire .... I don't know if this is a violation .. putting an external link.


Thanks
 
Upvote 0
File uploads are not allowed here AFAIK, so it wouldn't matter how small it is. Some forums require that you zip the file so keep that in mind.
I have it now but there's no form and no code in what you posted.
 
Upvote 0
I'm so sorry for the mistake .... Now the file is bigger


I couldn't make it smaller.

Regards
 
Upvote 0
First I'll say that you don't really have duplicate records per se. #29 has 2 different ticket no's so the records are not dupes. One way to eliminate that is to exclude the query fields that cause it. Maybe that will work for you. It turns out that the button you refer to in post 1 is a record navigation button (I saw no other buttons which use GoTo), which means that IF there is a fix you need it for both directions - double trouble.

The reason your file is so large is that you are using attachment fields. This is not advised; you will likely eventually exceed the size limit for an Access db. Use file paths instead, or move your tables to another platform such as SqlServer.

Your tables are not designed correctly. If you've studied database normalization, you should review. If not, you should review. For example:
- the primary key of employess table is the wrong field
- many fields are in that table that don't belong there. Employees are people and don't have a file type.
- you appear to have fields in 2 or more tables that are the same (e.g._oldID), yet are not related. If data is edited on one side, chances are good that the other side will remain unchanged, thus be wrong.
You are always going to have issues if you don't fix the design, which probably means starting over. If you do, I suggest you learn and adopt a proper naming convention. You could redesign your database while continuing to use this db as is. Then the problem should go away with proper design.

I think the main problem here is that since the query has multiple records for (e.g. REQ_NO = 30) you should be using a form/subform design. Whatever the parent thing is, the multiple req's would be in the subform. However, I cannot tell from that query what the "one/single" parent thing would be and that's another problem.

If I have the time I'll try to see if there is a temporary solution but it probably won't be today.
 
Upvote 0
Thank you Micron for your replay and all the information you've mentioned.

Your replay is more than enough.
I appreciate it.

I'll try to fix it by following your guidance.
 
Upvote 0

Forum statistics

Threads
1,216,100
Messages
6,128,825
Members
449,470
Latest member
Subhash Chand

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top