Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 16th, 2003, 09:26 AM
ironchef ironchef is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Cleveland
Posts: 112 ironchef User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 14 m 34 sec
Reputation Power: 6
inserting form information into a table in access

I have built a query that gets out Incentives that a Volunteer has earned. However, once in the access form, the volunteer has earned the incentive a user must approve this by entering the date the volunteer receives the incentive and then the values:
IncentiveTypeID, VolunteerID, and Date are inserted into the IncentivesReceived table of the database.

Here is my code and it works, sort of... it pops up parameter boxes for me to enter in the ID's and date and appends a row to the IncentiveReceived table.

Code:


Private Sub Text8_LostFocus()
    Dim strSQL
    
    strSQL = "INSERT into IncentiveReceived "
    strSQL = strSQL + "(`IncentiveTypeID`,`VolunteerID`,`Date`) "
    strSQL = strSQL + "VALUES ([IncentiveTypes]![IncentivesTypeID],[IncentiveTypes]![VolunteerID],[IncentiveTypes]![Date])"
    
    DoCmd.RunSQL (strSQL)
    
End Sub


Can anyone help?

Thanks in advanced.

Last edited by ironchef : December 16th, 2003 at 11:02 AM.

Reply With Quote
  #2  
Old December 16th, 2003, 12:26 PM
r937's Avatar
r937 r937 is offline
SQL Consultant
Click here for more information.
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 17,696 r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 1 Month 3 Weeks 6 Days 16 h 40 m 48 sec
Reputation Power: 986
you do say -- twice, in fact -- that the values are inserted into the table

(actually, the second time, you just say that a row is appended, and it might be appended with nulls, who knows)

so your problem is...?


by the way, i would not use the mysql-specific backticks around access table names

rudy
http://r937.com/

Reply With Quote
  #3  
Old December 16th, 2003, 12:33 PM
ironchef ironchef is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Cleveland
Posts: 112 ironchef User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 14 m 34 sec
Reputation Power: 6
I have a subform that displays IncentiveTypeID, IncentiveAward and Date that depend on the VolunteerID of the main form. What I would like to be able to do is:

[::] When a Volunteer earns an incentive that not only does it display the incentive but the IncentiveTypeID, VolunteerID and Date needs to be sent to the table (IncentivesReceived) when a user enters the date the incentive is received. Also, it has to be able to be updated, in case a user enters in a wrong date and changes it later.

[::] I don't want the parameters to pop-up I want it to be a automatic "grab the values and shoot them into the IncentivesReceived Table.

Thanks.

Last edited by ironchef : December 16th, 2003 at 12:35 PM.

Reply With Quote
  #4  
Old December 16th, 2003, 01:04 PM
r937's Avatar
r937 r937 is offline
SQL Consultant
Click here for more information.
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 17,696 r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 1 Month 3 Weeks 6 Days 16 h 40 m 48 sec
Reputation Power: 986
can't help you, pal, that's access programming, all i can help you with is the queries

good luck and i hope you find your access programmer

Reply With Quote
  #5  
Old December 23rd, 2003, 01:47 PM
wonderboy21 wonderboy21 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 1 wonderboy21 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Access has some funky rules. To be able to update from a query you need to do two things:

1) Join the query and table on the fields you want to update

2) In properties for the field to be updated find the Update To cell and list the field from which data is to be extracted

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > inserting form information into a table in access


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway