473,388 Members | 1,213 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Generate Mutiple Records using VBA

poucedeleon
I am building a database for logging in Officers into our building. It uses a continuous form. I have added a command button labeled "Multiple Bookings. OnClick it opens a form that has two comboboxes (Select Agency: fills in "AgencyName" on Main Form.) (Officer Name: fills "Officers Name" on MainForm.) and text field (Amount: states how many records to create) Each day we have groups of bookings arrive (Chain, Co-op, Comittments & DOC) These group can be from as little as 2 to as many as 30. I would like to be able generate multiple entries (Recordsets) using the comboBoxes and amount text field listed above. (I realize I will need a command button to run the code.) Is it possible to create multiple recordsets with some default data and some selected from the form. Trying to prevent my booking asst. from having to type the same info multiple times.
Sep 28 '07 #1
3 1345
Scott Price
1,384 Expert 1GB
You have posted your question in the Articles Section, I've moved it across for you to the main forum. Please do not post another thread with the same question, as this one will be attended as normal.

MODERATOR
Sep 28 '07 #2
MMcCarthy
14,534 Expert Mod 8TB
I would look at using the run sql statement like the following:

Expand|Select|Wrap|Line Numbers
  1. Dim strSQL As String
  2.  
  3.     'This assumes value1 is a string, value2 is a date and value 3 is some other datatype
  4.     strSQL = "INSERT INTO [table_name] ([column1], [column2], [column3]) " & _
  5.         "VALUES ('value1', #value2#, value3);"
  6.  
  7.     DoCmd.RunSQL strSQL
  8.  
You will need to work out the logic of what you are doing and maybe put this in a loop. You can use multiple statements like this.
Sep 28 '07 #3
FishVal
2,653 Expert 2GB
Hi, Kevin.

This is usually made via subform(s). To design subform you should have properly designed tables set.

Please include the MetaData for all relevant datasets. Here is an example of how to post table MetaData :
Table Name=tblStudent
Expand|Select|Wrap|Line Numbers
  1. Field; Type; IndexInfo
  2. StudentID; AutoNumber; PK
  3. Family; String; FK
  4. Name; String
  5. University; String; FK
  6. Mark; Numeric
  7. LastAttendance; Date/Time
Sep 28 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: LouD | last post by:
I have 5 tables in my db and when i bring up the linked form I get my product lists Tbls are tbStock, which contain unitcost, sellprice n qty tblProduct, contains ID, medicalname n genericname...
0
by: deepak | last post by:
i have set multiple selection property in bith listboxes(html control) to true. i have taken 2 buttons(html control) say Button1,Button2.now i want to add mutiple selected items to another listbox...
0
by: ward | last post by:
Greetings. Ok, I admit it, I bit off a bit more than I can chew. I need to complete this "Generate Report" page for my employer and I'm a little over my head. I could use some additional...
11
by: Alan Mailer | last post by:
A project I'm working on is going to use VB6 as a front end. The back end is going to be pre-existing MS Access 2002 database tables which already have records in them *but do not have any...
0
by: saravana | last post by:
I have to display the mutiple xml filename path in treeview control using c#. net some thing like this In treeview control....... ========= =C:\\a.xml=
2
by: wevans | last post by:
I have 3 tables, Customer, Offsite Service and service. I need to create a sales report/query based on the results of the user input, which is a date range. I've got it working great with two of the...
7
by: shanmugamit | last post by:
hi, i using mutiple check box but i didn't get all value... as $res=mysql_query("select * from cie where des='Resource Pipeline Associate' order by name"); $j=0;...
2
by: ravitunk | last post by:
hi..i have a datagridview in my windows application using C#......i want to select mutiple cells(by pressing shift key) or select mutiple columns or multiple rows.....if this happens then i should...
6
by: dewraj | last post by:
Hi I am using windows applicaiton(.net) as front end, and I want to get mutiple tables in Dataset by executing a single stored procedure i.e. SP would return mutiple tables (record sets) with the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.