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

Refreshing problem

173 100+
Ok, i have an add form that allows me to add site details......
on a different form i have a combobox from which i select a site name and it brings up the details.....

once ive added new details... i need to close the database down and go back into it for it to appear in the combobox??? ergghhh :(

when i add it from the add form, why cant it straight away show in the combobox???

ive added some requeries to my code below. (please note there are a few comboboxes on that form)

Combo2 searches sites by name and only shows live or pending
Combo22 searches sites by telephone numbers
Combo3 searches sites by names and only shows cancelled lines

WHAT SHALL I DO??? CAN SOMEONE LOOK AT MY CODE???

Expand|Select|Wrap|Line Numbers
  1. Private Sub add_Click()
  2.  Dim strSQL As String
  3.  DoCmd.SetWarnings False
  4.  Dim strmsg
  5.  strmsg = "Are you sure you want to add " & site & " to the table?"
  6.  
  7. If MsgBox(strmsg, vbYesNo) = vbYes Then
  8.  
  9.  strSQL = "INSERT INTO tab_data ([product], [provider], [site], [tel], [address_1], [address_2], [address_3], [postcode], [ip], [username], [password], [use], [type], [status], [notes], [line_provider], [line_status]) VALUES ('" & Me.Combo26 & "','" & Me.provider & "','" & Me.site & "','" & Me.tel & "','" & Me.address_1 & "','" & Me.address_2 & "','" & Me.address_3 & "','" & Me.postcode & "','" & Me.ip & "', '" & Me.username & "', '" & Me.password & "','" & Me.use & "','" & Me.Combo50 & "','" & Me.status & "','" & Me.notes & "','" & Me.line_provider & "','" & Me.line_status & "')"
  10.  
  11. ''Debug.Print strSQL
  12. [Forms]![Form1]![Combo2].Requery
  13. [Forms]![Form1]![Combo22].Requery
  14. [Forms]![Form1]![Combo3].Requery
  15.  DoCmd.RunSQL strSQL
  16.  DoCmd.SetWarnings True
  17.  End If
  18.  
  19.  
  20. End Sub
Feb 8 '07 #1
1 1353
Rabbit
12,516 Expert Mod 8TB
The problem is that your SQL Insert is after your requeries. What's happening is it requeries and then it inserts. Move your insert up.
Feb 8 '07 #2

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

Similar topics

3
by: Bernard André | last post by:
Hi All, context: I am using Access 97 tablkes with VB. I can see records in the MDB, using Adodc and datagrid. No problem. But when doing: rsprivate.AddNew rsprivate!For =...
1
by: sentinel | last post by:
Hello, I'm having problems refreshing a main window, and am not sure really whether the solution will be Javascript or PHP related. Firstly, I have a main file that calls a pop-up box which...
60
by: A.Translator | last post by:
I have been struggling with a page that is based on a table structure (because that is all I am feeling comfortable with at the moment) styled with css. One of the problems I run in to is Opera...
3
by: John Ortt | last post by:
I appologise for reposting this but I have been trying to find a solution all week with no avail and I was hoping a repost might help somebody more knowledgable than myself to spot the message... ...
0
by: msnews | last post by:
Hi -- I'm very, very new to ASP.Net, and I've been trying for several days to figure out how to update a datagrid AND refresh it on the client side so that the page doesn't refresh. I've torn my...
5
by: Scott Tilton | last post by:
I am having a terrible time getting this to work. I am hoping someone out there can help me with very specific code examples. I am trying to get the linked tables in my Access 97 database to be...
1
by: Jennyfer J Barco | last post by:
Hello I have a datagrid and a linkbuttom in the datagrid that says Picture, every time I click on the link "Picture" my program opens a popup window showing a picture of the item the selected and...
0
by: sean.hpr | last post by:
Hi all- I am a vb2005 newb so apologies in advance. Essentially I am having some problems with data refreshing on some of my forms. Background: I have created a project containing a few...
5
by: chimambo | last post by:
Hi all, I have a problem with maintaining data without refreshing manually in my system. I have a system which carries data across several pages. But if a user wants to go back to the previous...
13
by: honey99 | last post by:
Hi! I have to fix a problem in JSP.Actually,i have a JSP page say Ex1.jsp.In this Ex1.jsp i have an anchor tag which links into another JSP page i.e when i click on the link another pop-up window...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
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...

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.