Hi
Something that has been bothering me is when I click tab to move the cursor to the next field on a form it goes into a field that is not the next one :eek: (if that makes sense). I think this is because I rearranged the fields. I dont want to rearrange them back. How :confused: would I be able to set Access so when I press tab it goes into the next field.
I wish to place a command button next to a specific field which when clicked, launches the search command ready to search records against that field.
I have already tried this and managed to place a button to search - however, this searches every field in every record - I just want to search 1 specific field.
I am a bit new to this, so please be as untechy as possible!
I have searched the forums and tried various options but I get an error message about the syntax.
The button is to run a SQL query to update a field by calculating on the value of a another field on the form. The query is DoCmd.RunSQL "UPDATE BatchPayments SET BatchPayments.[GST Amount] = (BatchPayments.[Net Amount]*0.1) WHERE BatchPayments.BatchPaymentsID=" & Me.BatchPaymentsID&";"
The error message is a compile error where it is expecting a list separator or ).
I've got to copy the value of field A so it appears in field B. Field B may be changed, but field A cannot be changed. What's the best code to put into my button to copy the value of field A into field B.
I'm trying to include a field in a form by putting the form in the design view, however, when I try to press the button 'Add Existing Field' or 'Property Sheet' in the Tools group Access doesn't do anything.
I have tried to search on the web for possible solution but I haven't found one yet but I did read about disabling the shift-key feature which may have something to do with it.
On an access 2010 form if there are 5 fields (Number,Address,Gender,Age,Date). Is it possible to use a button to export 3 fields (Number,Age,Date) to an excel spreadsheet (Master) and place them in a specific worksheet (Info)?
I got a form with a field called [copies on hand] so i made a command button and when i click the button, i want the value in the field [copies on hand] to be subtracted by one.....
The code i have thats not working is
Private Sub Command 25_Click() If [copies_on_hand] >0 Then [copies_on_hand] = ([copies_on_hand]-1) End Sub
We have an old laptop running XP.I have an old Access 2000 disc which I no longer use, and this has been loaded to that machine.I am trying to build a very simple database to keep track of the members hours.The table name is Main_Table, the fields are; [ID],[Name].[Hours].A form exists Sign In.On the Form,Sign In I need a Combo Box or List Box to select a record (name) then a command button which adds 2 hours to the number of hours already in the [Hours] field of that selected record, simple as that.I cant get anything to run
I am one of the guys that the dept. drops 1k to send to the beginner through expert level courses for Access, so I ask patience as I am new to VB coding.
I am working on a database to track patient surgical information. I am using a toggle button to control "patient surgery site" visibility, depending on the number of sites associated with them. They are labeled Site A Site B, Site C
What I want is if a patient only has one site, I press the appropriate toggle (Site_A_Button, Site_C_Button, and Site_C_Button) and only fields pertaining to Site A appear. If they have 2 sites, I can press both of the toggles for A and B, but the C will remain hidden, etc.
Each toggle controls 3 fields - For the Site A button - Site_A, Diagnosis_A, A_Blocks_Check For the Site B button - Site_B, Diagnosis_B, B_Blocks_Check For the Site C button - Site_C, Diagnosis_C, C_Blocks_Check
The *_Blocks_Check also controls visibility for a respective fourth field - Site_A_Blocks , Site_B_Blocks , Site_C_Blocks
So far, I have A and B working just fine. By default, the toggle for A is set to -1 so it is visible by default. Site B and C are default 0. Both A and B work exactly as I want them to, however, site C does NOT. It has identical coding as B, however, it is visible by default (despite the "default 0") and the Site_C_Blocks visibility (controlled by the Check Box) also does not work properly. Here is the VB-
Private Sub A_Blocks_Check_Click() If A_Blocks_Check = 0 Then Site_A_Blocks.Visible = False End If
If A_Blocks_Check = -1 Then Site_A_Blocks.Visible = True End If End Sub
Private Sub B_Blocks_Check_Click() If B_Blocks_Check = 0 Then Site_B_Blocks.Visible = False End If
If B_Blocks_Check = -1 Then Site_B_Blocks.Visible = True End If End Sub
Private Sub C_Blocks_Check_Click() If C_Blocks_Check = 0 Then Site_C_Blocks.Visible = False End If
If C_Blocks_Check = -1 Then Site_C_Blocks.Visible = True End If End Sub
Private Sub Site_A_Button_Click() If Site_A_Button = -1 Then Site_A.Visible = True End If If Site_A_Button = -1 Then Diagnosis_A.Visible = True End If If Site_A_Button = -1 Then A_Blocks_Check.Visible = True End If
If Site_A_Button = 0 Then Site_A.Visible = False End If If Site_A_Button = 0 Then Diagnosis_A.Visible = False End If If Site_A_Button = 0 Then A_Blocks_Check.Visible = False End If
End Sub
Private Sub Site_B_Button_Click() If Site_B_Button = 0 Then Site_B.Visible = False End If If Site_B_Button = 0 Then Diagnosis_B.Visible = False End If If Site_B_Button = 0 Then B_Blocks_Check.Visible = False End If
If Site_B_Button = -1 Then Site_B.Visible = True End If If Site_B_Button = -1 Then Diagnosis_B.Visible = True End If If Site_B_Button = -1 Then B_Blocks_Check.Visible = True End If End Sub
Private Sub Site_C_Button_Click() If Site_C_Button = 0 Then Site_C.Visible = False End If If Site_C_Button = 0 Then Diagnosis_C.Visible = False End If If Site_C_Button = 0 Then C_Blocks_Check.Visible = False End If
If Site_C_Button = -1 Then Site_C.Visible = True End If If Site_C_Button = -1 Then Diagnosis_C.Visible = True End If If Site_C_Button = -1 Then C_Blocks_Check.Visible = True End If End Sub
Now I know this is probably sloppy coding, but it was the only way I could get this to work properly at all, so feel free to critique as well.
I want to actually add additional sites (Site D and Site E), but not until I can figure out why the problem is with just A B and C.
I apologize if this seems a bit confusing, but if anyone could help out, I would be most appreciative!
I have a form which lists Employees (flds EmployeeID (pk), Surname etc.) and a form listing Absences (flds AbsenceID(pk), EmployeeID(fk), StartDate...etc.).
from the employee form, I want to use a command button that will take me to the Abscences form but auto insert the EmployeeID and then I can fill out the rest.
I tried the go to form command for the button but its only looking for existing absences with that ID?
Getting better - but still far from being competent with VB can someone please help me with the following code.
On the On Click event of a command button I want to call up a field (from another table/form) and add A to it so it lands in a text box. So using the following example -
The table/form is called Patient and the field in question is URNumber. The form I want to put the command button is called RelatedDetails, and in a text box (IDNo) I want to put code that creatsed URNumber with an A on the end (or the beginning) Any ideas?
Ok so the Data I have holds a hyperlink to a file this field is "basepath".In Form view I want to have a command button that reads the basepath (for that record) then opens said hyper link.
I'm fairly new to Access / VBA and have been trying relentlessly to get a text box / search button on my Access form to pull up a specific record. Although the null command produces the correct error msgBox, it does not show any record if I enter a correct primary key term.
Code: Private Sub SearchButton1_Click() If IsNull(SearchField1) = False Then Me.Recordset.FindFirst "[UniqueAEVRef]='" & SearchField1 & "'" Me!SearchField1 = Null If Me.Recordset.NoMatch Then MsgBox "No record found", vbOKOnly + vbInformation, Me!SearchField1 = Null End If End If End Sub
I know all of the main features and can even do a bit with macros and VBA. I need creating a button to auto-fill a field in all the records in a table.
I have a database centered around a table called tblCand; each record contains a date field called intDate. On the main form, initDash, when the user hits a certain button, a window pops up (either a message box or perhaps a separate form) that asks the user to type in a date, which would be stored as intDateDB. When the user hits OK, I want the value of intDateDB to replace the value of intDate in all the records in tblCand.
I'm not sure whether this is called auto-filling or auto-populating...
.I'm trying to pass a field ([txtUPRN]) in a form to a hyperlink or button on the form.
e.g. [URL]
I thought I could add a hyperlink and simply change the part 'jlocation = 26800' to 'jlocation = Me![txtUPRN]' but this would be too easy as it doesn't work. THe URL still opens a web page but displays no data. Do I have to be more explicit as to what I'm passing in i.e. use the full form name or am I going about this the wrong way?
I have all of my text fields disabled and I want the user to press a button to make them enabled. I have a field that links to the database called, "lastName".Under the button's clicked property, I have coded,
Private Sub Command44_Click() lastName.Enabled = true End Sub
I'm having a problem trying to update a date field from a button.
I have a form called Add_New_Domain which runs from a table called Domain_Names.
Within the form there is a field called Expiry_Date which tells me when the domain is set to expire. When I first create an entry I manually enter a date in here.
However, every year when the domain renews I would like to increase this date by exactly a year by clicking a button which is also on the form.