Move and renumber records

elyleeboy

Registered User.
Local time
Today, 13:48
Joined
Sep 9, 2004
Messages
20
Hi all

I have a database that contains a list of records... ie:

1 | Question one text | Option 1 | Option 2 | etc...
2 | Question two text | Option 1 | Option 2 | etc...
3 | Question three text | Option 1 | Option 2 | etc...
4 | Question four text | Option 1 | Option 2 | etc...


I am not usinig autonumber, there my column titles are:
QuestionID | qText | Opt1 | Opt2 | etc...

What I am trying to do is give the user the option to move a question into a different position and therefor it takes on the QuestionID and then sorts by the QuestionID.

For example, I want to move question 4 into postion 2, therefor returning:

1 | Question one text | Option 1 | Option 2 | etc...
4 | Question four text | Option 1 | Option 2 | etc...
3 | Question three text | Option 1 | Option 2 | etc...
2 | Question two text | Option 1 | Option 2 | etc...


Any help would be greatfully appreciated

Ta
 
Don't quite get what you mean??
 
Option1, Options2, etc. is the approach you would take if using a spreadsheet tool.
Since you are using a database tool it would appear, by that table design, that you are mistaking it for a spreadsheet tool. Look at the suggested structure for a survey database by Pat Hartman on the link I posted - that's a logical design for a survey database.
 
Dim currDB As DAO.Database
Dim currRS As Recordset
Dim lngMove As Long
Set currDB = CurrentDb()
Set currRS = currDB.OpenRecordset("AllQuestions", dbOpenDynaset)

lngMove = 2
currRS.Move lngMove.


Would the 'move' method not work, something like the above (althought this doesn't work either!).

Sorry about my level of experience... I have just been TOLD to create this functionality.

Thanks
 

Users who are viewing this thread

Back
Top Bottom