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

Form doesn't save to Database

Hi

I am relatively new to Access and I am coming to a pecuiliar problem. I've set a form with some text field with control source set to certain fields that inserts some data using textbox.value = dloolup(etc) during form_load. But when i close this form and move onto the next form, the textbox data isn't updated into the table. But if i go into datasheet view and update those fields manually and press ctrl-s the tables are updated.

Any suggestions or recommendations ?

Thanks, Dave
Dec 7 '06 #1
5 2332
MMcCarthy
14,534 Expert Mod 8TB
Can you post the form load code?

Mary

Hi

I am relatively new to Access and I am coming to a pecuiliar problem. I've set a form with some text field with control source set to certain fields that inserts some data using textbox.value = dloolup(etc) during form_load. But when i close this form and move onto the next form, the textbox data isn't updated into the table. But if i go into datasheet view and update those fields manually and press ctrl-s the tables are updated.

Any suggestions or recommendations ?

Thanks, Dave
Dec 7 '06 #2
Expand|Select|Wrap|Line Numbers
  1.     Me.paddressText.value = DLookup("[paddress]", "12_mth_Phone_Participant1", "ID='" & [ID] & "'")
  2.     Me.phoneText.value = DLookup("[phone]", "12_mth_Phone_Participant1", "ID='" & [ID] & "'")
  3.     Me.pcityText.value = DLookup("[pcity]", "12_mth_Phone_Participant1", "ID='" & [ID] & "'")
  4.     Me.pstateText.value = DLookup("[pstate]", "12_mth_Phone_Participant1", "ID='" & [ID] & "'")
  5.     Me.pzipText.value = DLookup("[pzip]", "12_mth_Phone_Participant1", "ID='" & [ID] & "'")
  6.     Me.dateText.value = VBA.date
  7.     Me.AAText.value = [Forms]![00_1 Switchboard]![12AA]
  8.  
thanks,

the data loads correctly into the textbox. This problem also occurs if i change the textbox manually to something else.
Dec 7 '06 #3
MMcCarthy
14,534 Expert Mod 8TB
Expand|Select|Wrap|Line Numbers
  1.     Me.paddressText.value = DLookup("[paddress]", "12_mth_Phone_Participant1", "ID='" & [ID] & "'")
  2.     Me.phoneText.value = DLookup("[phone]", "12_mth_Phone_Participant1", "ID='" & [ID] & "'")
  3.     Me.pcityText.value = DLookup("[pcity]", "12_mth_Phone_Participant1", "ID='" & [ID] & "'")
  4.     Me.pstateText.value = DLookup("[pstate]", "12_mth_Phone_Participant1", "ID='" & [ID] & "'")
  5.     Me.pzipText.value = DLookup("[pzip]", "12_mth_Phone_Participant1", "ID='" & [ID] & "'")
  6.     Me.dateText.value = VBA.date
  7.     Me.AAText.value = [Forms]![00_1 Switchboard]![12AA]
  8.  
thanks,

the data loads correctly into the textbox. This problem also occurs if i change the textbox manually to something else.
Are you sure the form is bound to the relevant table and textbox controls all have their control source set to the relevant fields.
Dec 7 '06 #4
Are you sure the form is bound to the relevant table and textbox controls all have their control source set to the relevant fields.
Yes, but i'll double check. But given that i updates correctly under datasheet view when i press ctrl-s, doesn't that suggest it is set correctly ?
Dec 7 '06 #5
MMcCarthy
14,534 Expert Mod 8TB
Yes, but i'll double check. But given that i updates correctly under datasheet view when i press ctrl-s, doesn't that suggest it is set correctly ?
It does but there is no reason for it to update in one view and not in the other. Of course there is always the unmentionable corruption issue. Hopefully that's not the problem.

Check the form properties as well. Make sure allow additions and allow deletions are set to Yes.

BTW, in the form load how are you setting the value of the ID field. I know you said the textboxes were filling correctly but it's strange that the data is not updating.

The only other thing I can think of; is there any code in the forms unload event or have you got a save button on the form that is being clicked in form view but not available in datasheet view. If so what is the code behind that button.

Mary
Dec 7 '06 #6

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

Similar topics

6
by: Christopher Brandsdal | last post by:
Hi! I get an error when I run my code Is there any other way to get te information from my form? Heres the error I get and the code beneath. Line 120 is market with ''''''''''''Line...
1
by: Andy Kasotia | last post by:
I have an ASP UI with VB Dll as a COM object that access the DB2 Database. I have a "Calculate" button on the ASP Page which when clicked does form validation (javascript) and submits the form...
16
by: David Lauberts | last post by:
Hi Wonder if someone has some words of wisdom. I have a access 2002 form that contains 2 graph objects that overlay each other and would like to export them as a JPEG to use in a presentation....
3
by: emajka21 | last post by:
Hello, and thank you in advance for trying to help me. I am trying to create an access 2000 form without using the wizard. It just doesn't seem like I can the level of complexity I want out of the...
14
by: jmDesktop | last post by:
I have a food menu. Each area, like beverages, grill, etc. have items under them, Coke, Tea, Coffee would be under beverages for example. I want to add a new drink to beverages. In my database...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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)...
0
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...
0
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...

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.