473,795 Members | 2,882 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Duplicating a Form and subform in MS Access 2007

1 New Member
Hello;
I am in serious need of help. I have a form with subform that I am developing to fill in multiple data on customer orders. the need has come to duplicate up to 10 times the information on the Form and Subform with just the orderID changing. I tried append query with no success because my MS Access program will not recognise the [Forms]![Orders].[Tag] line as valid, so i cannot wright to the Tag property. I am now using the SQL statement

If Me.edit_subform .Form.Recordset Clone.RecordCou nt > 0 Then
strSql = "INSERT INTO [Order Details]([Part Number],[Part Discription],[Part Quantity],[Unit Price],[Order ID]) " & _
"SELECT " & lngID & " As NewID, [Part Number],[Part Discription],[Part Quantity],[Unit Price]" & _
"FROM [Order Details] WHERE [Order ID] = " & Me.OrderID & ";"
Debug.Print strSql

DBEngine(0)(0). Execute strSql, dbFailOnError

But I keep getting the following error

"Data Type mismatch in criteria expression"

I need help I have dumbed this down as much as possible and still cannot find the problem.

Can anyone help.
Apr 19 '11 #1
0 1207

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

Similar topics

5
3655
by: ego | last post by:
Hi all , I had created the following Form/SubForm structure : MainForm SubForm A (SubForm of MainForm) SubForm B (SubForm of SubForm A) SubForm C (SubForm of SubForm B) SubForm D (SubForm of SubForm C)
7
7895
by: wwwords | last post by:
I have a form in Access 2007 containing a subform. The control source of the latter is SELECT DISTINCTROW ., ., ., ., . FROM ; which is undoubtedly correct. However, if I click on the down arrow on the subform header (the one that should bring up the sort and filter menu) I get this error:
14
47247
by: TimmyNZER | last post by:
Hi, I would like to be able to have a button on a form, that when clicked will add specific information from that form to a table. I would be greatful to anybody who can tell me how to do this! I assume that I have to give the 'text boxes' a specific name, but I need the code for the button that will search for that specific text box, then add it to a specified table. Many thanks in advance, Tim Matthews
2
1686
by: liamgilligan | last post by:
Hey Everyone, I am a bit of a noob at this, but have to build this database and would love some help if anyone can provide any. I have a database designed at capturing customer satisfaction surveys. I have a table that captures answers to several different questions, ie; Q1 - Rating (either Excellent, Good, Average, Poor) Q1 - Score (either 10, 6.7, 3.3, 0)
2
41594
by: Brad Williams | last post by:
I have a linked Sub Form in Access 2007. It is designed to only show one Record. (Always 1). How do I Hide / Remove the Record Navigation bar for the subform? Thanks Brad
1
3598
by: Connell | last post by:
Are there new guidelines for using Query by Form in Access 2007? I have not been able to construct such a QBF using the techniques that worked in prior versions. For example it won't accept date fields provided by my QBF_Form (an unbound form using an unbound text box.) When I execute the code to open a report whose query uses a criteria such as "Between Form!! And Form!!, Access doesn't appear to look to the QBF form for the criteria, but...
4
6491
by: TD | last post by:
I am trying to change the forecolor of a field in a subform that is in datasheet view. I am using Access 2007. I have tried everything I can think of to do this but the text still appears in black. I need it to appear in red if the field has the word "YES" in it. Is there something in Access 2007 that keeps this from working?????
9
6010
by: gabrielro | last post by:
hi there First of all, I'm very glad that I found this big online comunity. I hope I will find the answer for my problem. It might have been asked before so please excuse me if so. So I have to create a logon form to connect to a database the database has a table called "users" where the user_id, username and password for each user is stored. I'm having trouble solving the authentication part where the user and password typed in form...
0
933
by: soonboknz | last post by:
I have created a Access2007 database. and imported old data from 2002 version. Sometimes, after I export a report, or edit a form, and then when I open a form, it says ; File not found.
4
4687
by: neelsfer | last post by:
Hi This code worked until i changed the "RaceNo" file to text from number format. What brackets or code should i change to make it work? This is to prevent duplicate entries. thx for helping Neels Private Function IsDuplicateRecord() As Boolean On Error Resume Next
0
9673
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9522
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10002
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9044
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6783
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5437
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5565
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3728
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2921
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.