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??? - Private Sub add_Click()
-
Dim strSQL As String
-
DoCmd.SetWarnings False
-
Dim strmsg
-
strmsg = "Are you sure you want to add " & site & " to the table?"
-
-
If MsgBox(strmsg, vbYesNo) = vbYes Then
-
-
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 & "')"
-
-
''Debug.Print strSQL
-
[Forms]![Form1]![Combo2].Requery
-
[Forms]![Form1]![Combo22].Requery
-
[Forms]![Form1]![Combo3].Requery
-
DoCmd.RunSQL strSQL
-
DoCmd.SetWarnings True
-
End If
-
-
-
End Sub
1 1353
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.
Sign in to post your reply or Sign up for a free account.
Similar topics
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 =...
|
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...
|
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...
|
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...
...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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...
|
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...
| |