Is it possible to add more than one record at the same time?

kate10123

Registered User.
Local time
Today, 21:54
Joined
Jul 31, 2008
Messages
185
Hi there,

I have a data entry form which has a search option. This allows users to search for a student and then populate some fields in the form. Sometimes tutors will want to enter data for students that have no record in the database.

I am thinking the easiest way to group these 'Anon' entries is by creating a record called 'Anonymous' which will allow the tutors to save data to this made up record.

Sometimes they may have seen 5 students whom did not disclose their details and to save 5 separate entries is it possible to have a textbox on the form to enter a quantity and for this quantity to translate into how many records go in the database?

I haven't seen any examples of this before
 
I deleted my last post as I misread what you said, appologies! Yes you can use the 'save and duplicate' feature to save 5 records. I guess if you really wanted to have a textbox on the form that you enter a number of how many times you wanted the record saved, you can use VBA to read the text box, save and duplicate the record, and subtract 1 from the textbox. Repeat process until the textbox reads 0. Otherwise you could have a command button that you press manually 5 times, that will save 5 identical records.
 
It is interesting seeing the ways this can be achieved. I think the VBA to read the value of the textbox would be a safer option in case the users click too many times.

(Some are still learning when to click once and when to double-click :))
 
Hi, would it be possible for you to show me some example code to do the textbox subtraction.

I have googled different words but the code I am finding seems to be more complex than it needs to be.

Thanks :)
 
Adding dummy records for someone that doesn't exist, how strange?
 
someone does exist called 'Anonymous' and it is this that allows me to create records that do not have a particular student identity. I just need a way of converting a save into multiple records.
 
someone does exist called 'Anonymous' and it is this that allows me to create records that do not have a particular student identity. I just need a way of converting a save into multiple records.
Just to further satisfy the curiosity, what happens if two or three JonDos are needed?
 
I have a student table where all the info on each student is stored and I have a tutorial table which keeps information on each tutorial.

Each student can have more than one tutorial so more than one 'JonDos' is possible in the tutorial record if 'JonDos' has had more than one tutorial. He cannot exist twice in the student table!
 
Further to yesterday I have been playing around with the input box function. I think this would work well with what I am trying to do.

If the user selects 'Anonymous Enquiry' from the list then it prompts the user to enter a number. Now what I need help with is translating the number into a number of records to be created.

Here is what I have so far:

Code:
Dim Message, Title, Default, MyValue
     If TutorialType.Value = "Anonymous Enquiry" Then
         Message = "Enter the number attended (max of 8)"  ' Set prompt.
         Title = "InputBox Demo"    ' Set title.
         Default = "1"    ' Set default.
         
         ' Display message, title, and default value.
         MyValue = InputBox(Message, Title, Default)

         ' Use Helpfile and context.
         ' The Help button is added automatically.
         MyValue = InputBox(Message, Title, , , , "DEMO.HLP", 10)

         ' Display dialog box at position 100, 100.
         MyValue = InputBox(Message, Title, Default, 100, 100)
     End If
 
You could put a text box on the form and name is "NoOfDuplicates".

In your VBA code, you can get the value of the textbox by using something like:

Dim NoOfRecs As Integer

NoOfRecs = [Forms]![EnquieryForm]![NoOfDuplicates]

You can then use the 'save and duplicate' code that looks something like this:

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste Append

You can add a For Next loop around it so it cycles around the number of times given by NoOfRecs.

At the end of the code, you will have to set the value in the text box back to 0. You can do this by using:

[Forms]![EnquieryForm]![NoOfDuplicates] = 0

I'm certain this can work fine.
 
DoMenuItem has been obsolete since 1996, replace it with the RunCmd
 
DoMenuItem has been obsolete since 1996, replace it with the RunCmd

I guess Access 2003 SP2 is well out of date then, because thats what the wizard uses when you put a control box on a form, and select 'Duplicate Record'. But thanks for the tip I know I have a lot to learn.
 
I guess Access 2003 SP2 is well out of date then, because thats what the wizard uses when you put a control box on a form, and select 'Duplicate Record'. But thanks for the tip I know I have a lot to learn.

Unfortunately one part of the Access development team doesn't talk to the other;)
 
However

Rich is surely correct

Why on earth would you need to save records for someone that doesn't exist.

The only think I can think, is that maybe an uxpected student has turned up who hasnt preregistered for the class, so the tutor has to enter his details. so you need to allow the tutor to store a record, to be picked up later, when he registers properly - i would store his name, rather than anon, and you would need a mechanism to match the tutor records against the later registrations
 
Some students will never provide their details to exist on the database for several reasons, the most obvious being that they might not want anyone to know they have needed extra tuition.

To group these types of students together and to be able to still show accurate statistics I have created a record in the student table called 'Anonymous'.

Anyone that has not registered is effectively in this category so when it comes to the tutor recording the details of the tutorial, if they have seen a number of students under this category they can still record it.

Sorry I realise that my original post was very vague :)
 

Users who are viewing this thread

Back
Top Bottom