473,322 Members | 1,494 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,322 software developers and data experts.

Trying to capture data from one table and place it in another

46
Hi,

I'm trying to find some records in a table that has been exported into Access (tbl_test). The new table that I am trying to create and insert the data to is called (tbl_test1).

Here's my code - I'm trying to find where the word 'Interval Type' starts to capture the data from there and on down a few rows. The 'Interval Type' row will be the name of the first field in the new table, and then the second row is blank so I tried looking for a row with a Null Value . . .after that row I want to capture all the data until I reach another Null row- and place all that data into the new table: tbl_test1.

I'm not able to come up with it - please tell me what i'm doing wrong.
Expand|Select|Wrap|Line Numbers
  1. Private Sub btntest_Click()
  2.    Set rstAllImported = CurrentDb.OpenRecordset("tbl_test", dbOpenTable)   ' this is the input table
  3.    Set rstSleepInterval = CurrentDb.OpenRecordset("tbl_test1", dbOpenDynaset) ' this is the actual data table
  4.  
  5. ' read the input table and see the record that has "Interval Type" can be found
  6.     rstAllImported.MoveLast
  7.     rstAllImported.MoveFirst
  8.  
  9. SkipRecord:
  10.     If rstAllImported.Fields("Actiware Export File  (Version 03#00 )") <> "Interval Type" Then
  11.         rstAllImported.MoveNext
  12.         GoTo SkipRecord
  13.     End If
  14. Me.lblTest.Caption = "success"
  15.  
  16.             Do While Not rstAllImported.EOF
  17.                 If rstAllImported.Fields("Actiware Export File  (Version 03#00 )") Is Null Then    ' find first blank record found
  18.                     'If rstSleepInterval.NoMatch Then
  19.                         Put_Interval_Data
  20.                     'End If
  21.                 Else
  22.                     Me.lblnumberthree.Caption = "is this working?"
  23.                 End If
  24.  
  25.                 rstAllImported.MoveNext
  26.             Loop
  27.  
  28.     rstAllImported.Close
  29.  
  30. End Sub
Dec 18 '08 #1
3 1672
NeoPa
32,556 Expert Mod 16PB
As a full member now, you should know that we expect your code to be posted in [code] tags (See How to Ask a Question and indeed the instructions in the posting window itself).

This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.

Please use the tags in future.

Administrator.
Dec 21 '08 #2
NeoPa
32,556 Expert Mod 16PB
Having tidied up the code display somewhat I find I am still at a loss trying to understand your question.

I would at least like to see if I can help. Unfortunately the explanation doesn't seem to be made up of any logical sentences. If you'd like to see if you can explain your problem in clear English (I don't intend to reverse engineer your code to save you the bother of asking the question properly), then I can promise I will at least look at it again.
Dec 21 '08 #3
missinglinq
3,532 Expert 2GB
As a full member, you should also know better than to post a problem more than once! Your duplicate posting of this problem has been deleted! Please refrain from this prohibited behavior in the future.

From FAQs

Do Not Double Post Your Questions

Double posting is where you start a thread on a topic and then for some reason start another thread on exactly the same topic in the same forum. Please do not do this because

1. It makes it very hard for people to answer you especially if there are answers happening in all the threads you have started because they have to read 2 or more threads in order to see what has already been said.

2. It swamps the forum with your problem resulting in less attention for the other threads.

If you feel for some reason that you post has been overlooked (for instance it hasn't had any replies) please do not repost the question. Post a message to the thread you started, this will bump it back to the top of the thread list for the forum.

Thank you for your attention in this matter.

Linq ;0)>


Moderator
Dec 22 '08 #4

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

Similar topics

5
by: NK | last post by:
Hi, We have a webpage that has a form available on the intranet. A user will have a window open that runs a different application open. When the user accesses the webpage and clicks a button we...
0
by: Mark Barinstein | last post by:
Hello. W2K, db2 v7, FP10a. Before now our replication worked properly. But some days ago capture suddenly stopped loggin and filling cd tables without any messages. The last message was like...
2
by: Iain Miller | last post by:
Struggling a bit here & would be grateful for any help. I have a table which has a list of people in it. Each person has a unique ID automatically allocated by Access but also belongs to one of 5...
11
by: hazz | last post by:
before I start filling up the first page of perhaps many pages of code with if/then or switch:case buckets, I wanted to step back and see if there is a better way... I will have a table with up to...
8
by: Ken Sturgeon | last post by:
I have a button inside a panel control. Apparently I can't expect VB to respond to the button's _Click event. How do I capture the click event? Thanks Ken
11
by: Ron L | last post by:
I have a barcode scanner which uses a "keyboard wedge" program so that the data it scans comes through as if it was typed on a keyboard. I am trying to have the data in the barcode be displayed in...
17
by: Timothy.Rybak | last post by:
Hello all, This is my first attempt at an application, so kid gloves are appreciated. I need to make a very simple form that only has a few elements. One is TraceCode - a text field that is...
3
by: questionit | last post by:
Hi I know i have posted similar question before but there is something i need to ask further to that. If you have many text-boxes on the form and you want to check if any changes to the data in...
3
matrekz42
by: matrekz42 | last post by:
Good afternoon gents, I'm trying to capture a dollar amt for a specific table running a link from another table. So I have the first and the second , and I'm trying to capture all the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.