Changing field order in a table with VBA

Hi Pascal,

Yes the fields.refresh is neccesary. Perhaps thats why the code is not working. I have tried it here and it works fine for me. How many fields are in your table altogether?
 
Marion,

I added my database below so you can see what's happening when running the code. Something strange: the order in the table in design view is different from the order in normal view (after the code has run). And the code is still not putting the fields in the order I want them to.

Pascal
 

Attachments

Hi Pascal,

I have put in 2 modules on Formular 1. As you know there are always different ways of doing things! ;)
 

Attachments

Hi Marion,

I think you've attached my sample database instead of yours.

Pascal
 
Marion,

This time I changed the position of all the fields in the table, including the new ones. In the table design mode all the fields were in the right position but when I switch to normal view there's always another field shown in the first column. Isn't that strange. What could have happened here? I think this hasn't got anything to do with the VBA code. Maybe a little bug in Access?

The code is working fine now thanks to you Marion.
Thank you very much.

Pascal
 
Hi Pascal,
My pleasure. In the normal view you can change the order of the columns by drag and drop and save it, then it always displays like that. It really doesn't matter though, as your end user usually doesn't see the tables anyway, only the forms you build to display the data.

Have a good day
Marion
 

Users who are viewing this thread

Back
Top Bottom