Trying To Place 2 After Update Procedures In 1 Combo Box
Oct 4, 2005
I currently have a combo box that is bound to a table with 2 fields and has 4 different options/records in it, with an after update procedure, that has different calculations for each record. I want to add a Dlookup command that will display
the record that is chosen in another text box and it will need to be placed in the
after update procedure of the combo box also. Is this possible?
Code that is currently in the after update procedure of the combo box.
Private Sub cbofelts_AfterUpdate()
Dim prp As Property, ctl As Control
Set prp = Me!cbofelts.Properties("ListIndex")
Set ctl = Me.txtfelts
If prp = 0 Then
ctl = ([TOTFLDSQ] / 4) + 0.4
ElseIf prp = 1 Then
ctl = ([TOTFLDSQ] / 2) + 0.4
ElseIf prp = 2 Then
ctl = [TOTFLDSQ] + 0.4
Else
ctl = ([TOTFLDSQ] / 3) + 0.4
End If
Set ctl = Nothing
Set prp = Nothing
End Sub
Code I need to add: (2nd after update procedure)
Me.Dlookfelts.Requery
Thanks-- any help will be very appreciated.
View Replies
ADVERTISEMENT
Oct 4, 2005
Hello, I ran into another programming road block.
I currently have a combo box that is bound to a table with 2 fields and has 4 different options/records in it, with an after update procedure, that has different calculations for each record. I want to add a Dlookup command that will display
the record that is chosen and it will need to be placed in the
after update procedure of the combo box also. Is this possible?
Code that is currently in the after update procedure of the combo box.
Dim prp As Property, ctl As Control
Set prp = Me!cboRidge.Properties("ListIndex")
Set ctl = Me.txtRidgetot
If prp = 0 Then
ctl = ([txtridge]*100/30)+0.4
ElseIf prp = 1 Then
ctl = ([txtridge]*100/45)+0.4
ElseIf prp = 2 Then
ctl = ([txtridge]*100/30)+0.4
Else
ctl = ([txtridge]*100/30)+0.4
End If
Set ctl = Nothing
Set prp = Nothing
Code I need to add:
Me.DLookcbotile.Requery
Thanks-- any help will be very appreciated.
View 1 Replies
View Related
Sep 11, 2006
Hi,
I am switching from sql server to msaccess and cannot find an equivalent of a stored procedure in access.
The task I want to do is the following.
1. I have a table with many field.s
2. I want to loop through all the fields and replace records which have a value of 0 with NULL.
How could I do this without writing seperate update statements for each of the fields.
Thanks.
View 5 Replies
View Related
Dec 2, 2004
I am creating a form here
the Main form need to fill in (or may already fill in in another form) some headings like date, name, memo details, ect.
On the subform, there is a procedure list out all the steps and need to fill out who have done this step, and date, etc
My main problem is on the subform, I have no idea how to create the "list out all steps". Because there are too many steps here, it may waste a lot of time if I have to type in the procedure name for each steps.
I have created a table of all steps' names.
Thank you for your hlep!!!
mugen_rsx
View 2 Replies
View Related
May 20, 2005
How do you make stored procedures in microsoft access 2003, can you actually do this or is it not part of access?
View 4 Replies
View Related
Nov 15, 2007
I have an Access mdb that has a bunch of tables linked from a SQL Server. On the SQL Server I have some stored procedures that do inserts into various tables. In the Access db I have some local (lookup) tables, queries, and other things that for various reasons can't/don't need to be stored in the SQL server. I'm using Windows authentication to connect to the SQL server because the security is managed through our domain.
I want to write a form that has unbound text fields that, when I submit the form passes all of those values as parameters to a stored procedure in the SQL server. I have written just such a form in an .adp file, which handles the integrated security nicely.
However, I'd rather do this in a regular .mdb file. I've read up on how I can use an ADO connection to do this, then create a SQL string to EXECUTE the stored proc, grab all the values off the form, and build the SQL.
But the problem with this solution is the authentication - I can't use the SA user and password in this connection string, I'd have to utilize the logged-in user's information.
Is there an easier way to execute the stored procedure from an .mdb? Using the integrated authentication?
Failing that, is there a way that I can create "local" (to the .adp) tables, queries, and so on in an .adp?
View 5 Replies
View Related
Aug 25, 2006
I come from a SQL Server background and am very familiar with store dprocedures and input parameteres.
Is there a way to use a similar method in Access. or example, passing parameters from a button on a form to a query, which can change depending on the input parameter? If so, how ?
Also, how much scope do you have in this for running SQL IF statements and such in the query? It seems that many Access queris can only have one statement at a time.
View 7 Replies
View Related
Feb 22, 2006
:eek: I can't seem to find one that will do what i want.
I have a tabbed interface. Tab one has details about that record e.g. clients
Tab two is an input form that lets you add new client
Basically after i added the client i want to go back to view this record in the first tab. i can put a button with Me.Requery, works fine.
Is there an Event Procedure on the form i can use to do this automatically?
Anyone got any good links to event procedures explanations.
View 5 Replies
View Related
Feb 27, 2008
Sometimes when I send a copy of an Access 2003 application to a remote user, a stored procedure or function will disappear. What causes this, and how can I get the entire application over to the users?
Thanks in advance!
View 6 Replies
View Related
Aug 4, 2006
Here's the deal:
I'm an extreme newbie, I do not know access very well, nor do I know VBA, I do know PHP.
I have a for in access that has 2 user input fields, one for prodid one for shipid. I have a combo box that upon entering data into the previous 2 fields, it does a query against an MsSQL database looking for a record that has both. In any case there will only be 2 outcomes, either 1 record, or null. I would like to have that same combo box automatically use the result as it's value so that users don't have to check the box, because they won't, and so that the rest of my VBA will be able to function properly.
Can anyone assist?
Thanks.
View 2 Replies
View Related
Aug 4, 2005
Hi,
I am calculating two fields (qtyorder-qtydesp) in a stored procedure.
The second field is from another query (view) which may not have a record relating to the main record (stored procedure).
The problem is the second field is simply left blank but I need it to be 0.
It makes the calculation in turn result in a blank field, i.e. 1-0 should equal 1 but because of the blank field it returns a null value.
I found that the good old Nz function wont work with stored procedures, is there any alternative?
Thanks,
James
View 5 Replies
View Related
Feb 20, 2006
I was working on a form in a database I have created, when I suddenly found myself unable to view any of the related Event Procedures.
I can still see [Event Procedure] next to each field, control, etc., as well as next to the On Open event. I just can't view any of them. I appear to be able to view the Events behind all other forms, it just isn't working for this particular one.
Clicking on the '...' to the right of the line does nothing, nor does right-clicking on this symbol and trying to access 'Build'.
Logging out of the Db, then back in, achieved nothing. Nor did rebooting the PC.
The only other peculiar thing I've noticed is that if I attempt to make a copy of this one form I get the message 'name conflicts with existing module, project or object library'. This message is displayed regardless of what name I enter.
Everthing was working fine, earlier on. Now I'm effectively locked out.
Does anyone have any ideas?
View 4 Replies
View Related
Jan 12, 2006
hey everyone!
Is there an option to use Triggers and stored procedures in access 2003?
thanks!!!
View 3 Replies
View Related
Mar 16, 2007
Just been upsizing an Access DB. It seems to create views and functions for normal select statements and stored procedures are only created for insert or update statements.
As fas as a recent DBA told me, he said that views should be used sparingly as they are not very efficient. Is this the case?
I also don't see why you would create a function when you could use a stored procedure to so the same SELECT statement(s)?
View 1 Replies
View Related
Dec 19, 2005
is there a way i can call a sub forms procedure from the main parent form.
in other words i have a button command i want to execute
View 2 Replies
View Related
Jan 22, 2015
How can i apply security or read only procedures to forms?
View 1 Replies
View Related
Sep 10, 2014
I have the following Event Procedures in a form:
Private Sub PrimaryDisability_Change()
Select Case Me.PrimaryDisability
Case "Other (Specify)"
PrimaryOther.Visible = True
Case Else
[Code] ....
My problem is that when I go to a new record, the fields that I want hidden in the new record unless they meet the criteria are still visible. I have looked all over online and in books to determine the code I use or whatever I need to do to make the field invisible in the new record and only to appear in each record if it meets the criteria.
View 13 Replies
View Related
Jun 20, 2005
Hi All,
I have a combo box on my form that is retrieving its list of values from a table. After I choose a value I want to write it to another table's field. I can get this to work where it is writing to the other table's field, but when I open the form to see the field of where the information is supposed to be writen to it is not refreshing. What property on the combo box should I used to ensure that the field of the other table is instaneously updated when the combo box's value is chosen.
Thanks
Greg
View 3 Replies
View Related
Jul 12, 2005
Hey All
I have a following problem - the user selects value from a combo box (cmbPrio), if there was already a value in there, new value get added, and no further action is made.
If there was no value, value is added, AND in txtDueDate date gets added (if user selected High - todays date + 5 days, if low - todays date + 10 days)
I was thinking of doing it the following way, but it doesn't work --
Value XX is not saving the data. Should it be maybe done for a different event ? And I also don't get the correct date...
Before Update
If isNull(cmbPrio) then XX = 2
After Update
If XX = 2
If cmbPriory.text = "High" then txtDueDate = Now + 5
If cmbPriory.text = "Low" then txtDueDate = Now + 10
End If
View 3 Replies
View Related
Dec 9, 2006
I have a form that displays a list of users and there programs in a sub form, I would like a combo box instead of the user ID number so that I can press on it and all the user ID's will appear, then I can select it and there details will apear. Can this be done?
View 6 Replies
View Related
Apr 21, 2006
I said I was a dummy, but here goes.
I am designing a customer information form, the form has an unbound combo box showing customer names and when clicked opens the customer record.
My problem is when I enter a new record, I have a button that saves current and opens new, but when I am in the new record, the customer I just added previously is not showing up on the unbound control, only when I close the form completely and re-open it.
Is there a code to update the unbound combo box when you click to go to new record.
View 3 Replies
View Related
Jul 17, 2006
I want to update a field (field1) in each record of a recordset (qryUpdate)
I got the following code (in green) working fine - so far so good. I actually need to update the field from a selection from an unbound combo box. This looks up a table with two fields Period ID (autonumber PK) and a text field called Quarter. I've tried various combinations including the code in red and code such as
"rst![field1] = Me.cboPeriod"
"rst![field1] = Me.cboPeriod.Column(0).value" etc
but can't get it to work. It has to be something simple but I can't see it.
Private Sub cboPeriod_AfterUpdate()
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("qryUpdate")
Do Until rst.EOF
If IsNull(rst![field1]) Then
rst.Edit
rst![field1] = 5
rst.Update
End If
rst.MoveNext
Loop
End Sub
Private Sub cboPeriod_AfterUpdate()
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("qryUpdate")
Do Until rst.EOF
If IsNull(rst![field1]) Then
rst.Edit
[rst![field1] = Me.cboPeriod.Column(0)
rst.Update
End If
rst.MoveNext
Loop
End Sub
View 3 Replies
View Related
May 2, 2007
Hello again all... Today's problem is as follows.... I have an "after update" combo box that is coded as "CurrentDb.Execute "Uno", dbFailOnError". I have an update query which I am trying to have a combo box from a form input information, update a table with what the combo box was inputted with. (if you follow). In my query, I have one field as showing the "Update To:" filed as "Forms![Loc-1L]!Combo8". When I try to run the query, it works in the query if I manually type in a location, however when running it in the form, it gives me the error: "Too few parameters. Expected 1". Any ideas where I'm going wrong?
View 2 Replies
View Related
Sep 2, 2005
Hi,
Hope someone can help. What I’m trying to do is have a combo box look up values from one table and add them to another. I have used the combo box wizard to look up a value from table1 and add it to table2 but is there a way that it can lookup 2 values and add them to the second table. For instance if I had to tables like :-
Table1
First Name
Last Name
Table2
First Name
Last Name
Can a combo box lookup and update both fields for example if I have a combo looking up the first name can it also lookup the last name and add them to the corresponding fields in the second table but with the user only selecting the first name in the combo box.
I’m sorry if I don’t make much sense I’m new to access and fairly new to forums
Thanks for your help
View 1 Replies
View Related
Jul 27, 2006
i have a form that i want to stamp with a date when it was last updated. if a change to the form is made it will be stamped with today's date. i used the BeforeUpdate event so that you could choose to save the edits or not so if you didn't mean to edit a record then the date would not change. the code is:
Dim myVar As Byte
myVar = MsgBox("Changes to this issue have been made. Would you like to save the changes?", vbYesNo + vbQuestion, "Save Changes?")
If myVar = vbYes Then
[LastUpdate].Value = Date
Else
Me.Undo
End If
my problem is that when i change the combo box values it will run this event and ask to save. i think the reason this is happening is because the comboboxes save when you change them. how do i accomplish the same task as above but allow the combo boxes to act like txt boxes?
also is there a way that when i ask if the user wants to save or not, to have a cancel button that will take no action, leaving the record open the way it was (new typing and everything) before the user tried to close the form without saving that info?
View 14 Replies
View Related
Sep 26, 2006
ok i have three tables..
Booking_Table
Booking_ID
Job_Date
Company_ID
Booker
Passenger
Company_Table
Company_ID
Company_Name
Address
Phone_No
Company_Staff_Table
Company_Staff_ID
Company_ID
Full_Name
Phone_No
each booking will only ever involve one company at a time
company 'A' will have several staff
person 'A' from company 'A' may book a job for themselves
person 'A' from company 'A' may also book a job for person 'B' from company 'A'
i have created a booking form
i have added a combo list displaying all the company names..(control="comp_combo")
i have also added a combo list displaying all staff names from all companies (control="staff_combo")
when the user selects company 'A' from the first combo.. i would like the staff combo to update and only display staff members for that company
how do i do this.
View 1 Replies
View Related