SQL Connection string

mardi 31 mars 2015

Dear all,

i would like to select combo box value that link to MySQL table field

May i know the connection string?



Thanks in advance!!!

SQL Connection string

Greetings!

Hi Everyone

Thank you for reading my post. I would like to take this opportunity to introduce myself. I am a data analyst. Although I have built few access databases, I am still having roadblocks now and then.



I ran into this site through searches online and it is very informative. I am excited to be part of this forum and having discussion with others who are expert in ms access. Hopefully, one day I should be able to pass my learning to other new members. THANK YOU.



Best Regards

Nixon

Greetings!

Hello from Philippines

Hello Everyone,



I am Chino a certified public accountant, very much happy to found this site,because I'm a CPA not a programmer I'm having a hard time dealing with my homemade MS access Accounting System. I already read lots of tutorial and e-books but I can't find the solutions to my problems I believe this is the right place to be :)



Thank you for accepting me and being part of the community looking forward working with you guys and I hope there is also ways I can help you with, even I'm not a programmer :)



Cheers,

Chino

Hello from Philippines

Message box for duplicate entry...

Dear all,

I am using access 2003 i would like to prompt message box should come out for adding the duplicate entry..

Example:

ID:1

User:a

i add the this record to my MySQL table from my access form by clicking the submit button then text box value become null, if i type again the same ID 1 and user a i need to have a prompt message "This is duplicate entry do you want to proceed" if yes proceed to add if no hold the action...



Thanks in advance!!!

Message box for duplicate entry...

Message box if we never change the textbox value...

Dear all,

I would like to display message box in access VBA if the user forget to change the text box value after clicking the submit button...

Example:

1 card contains 9 rows when they input the 7th row message box should come out "please remember to Change the card Number"



Thanks in advance!!! :)

Message box if we never change the textbox value...

Form don't open in Edit mode

Hi guys



This is the first time i experience from an .mde in an particular xpwin.pc1 (in LAN) that refuse to open a form in the another xpwin.pc0 in EDIT MODE. Other pc don't manifest this phenomena. Appreciate some pointers to tinker. :banghead:

Form don't open in Edit mode

[SOLVED] Passing Datasheet Value To Another Form

Hi All,

So I've been reading these forums about this issue of mine and I find very similar problems to the one I am having but I can't quite get the posted solutions to work. Maybe my mediocre knowledge of VBA is the issue, who knows :)



Anyway, I have a form that opens in datasheet view. It displays company names that exist on a client table based on a "Like" criteria the user typed into a text box. They type the word "network" in the text box, click search and a datasheet opens that has all companies that have "network" somewhere in the title. That's it. Works perfectly. We'll call this datasheet view form result "Test Query Form."



I have a second form that currently allows users to select a company from a drop down box and then populates the rest of the form with data from a table for that company. Again, works perfectly. We'll call this form "Existing Info."



I want to make a change to this second form. Rather than allow a drop down combo box for selection of the company, I want the "Test Query Form" to open the "Existing Info" form and automatically populate the form based on the company that the user double clicks on in the "Test Query Form." For instance, if I type in "network" and clicked search and got three companies with the word "network" in the company name, I want the user to double click on the second company name and have the "Existing Info" form open up with that second company on it and all the info populated for that second company.



I know this needs to be VBA code on the dblClick command for the company name cell on the "Test Query Form" but I can't quite get it to push the company name through to the "Existing Info" form.



Any help would certainly be appreciated, but please know that I am only moderately familiar with VBA so any descriptions of what a particular code you provide is doing would certainly help me learn as we go!

Thanks!

Mike

[SOLVED] Passing Datasheet Value To Another Form

Grouping and totals

I am trying to group my results of this query by ExamId and total by the number of correct answers. My results are very simplified granted. The "0" & "1" for "Correct" is a binary.... Thanks for any help!



SELECT A.ExamId,

A.QuestionId,

A.AnswerId,

A.Answer,

A.Correct,

FROM ExamAnswers A



the results currently appear like this:



ExamId QuestionId AnswerId Answer Correct

1 1 152 Blue 0

1 2 207 Aqua 1

1 3 166 Mauve 0

2 1 152 Black 1

2 2 207 Aqua 1

2 3 166 Mauve 1

3 1 152 Black 1

3 2 207 Green 0

3 3 166 Beige 0

Grouping and totals

Select Top issue

Hello ive used this sql for my query to allow me to view the medication history of my customers but for the last 10 records only..

the only issue is it only shows about 5 records and some are blank i have 5 other records in2014 but only 2015 appear





SELECT TOP 10 Medication.CustomerID, Medication.[mild], Prescriptions.[weak ], medication.[Date]

FROM Medication

WHERE (((Medication.CustomerID)=[Forms]![FrmAppointments]![CustomerID]))

ORDER BY Medication.[Date] DESC;



can someone help me :(

Select Top issue

simple report question (why am I brain dead?)

Hello,



I have a simple report that is based off a query that groups off a department code, and then sums the number of pc's in the dept.



So, the records come back in pairs...



Dept1, 4 PCs

Dept2, 6 PCs

Dept3, 10 PCs



Now the brain dead part:



How do I get a grand total? In this case I'd like 20 PCs to show on the bottom of the last page of the report.



I tried adding a text box with =sum(NumberOfPCs) in the footer for the grouped department field, but then the running total repeats for each department. e.g.



Dept1, 4 PCs

TOTAL: 4 PCS

Dept2, 6 PCs

TOTAL: 10 PCS

Dept3, 10 PCs

TOTAL: 20 PCS



How do I make this work without repeating the running total for every new group/department?



Desperate, I added the total text box to the page footer, but I get an error.



Can someone give me a push? Ugh. :banghead:



Thanks,

-Matt G.

simple report question (why am I brain dead?)

Hello from Switzerland

Hi everyone,



best regards from Switzerland

Hello from Switzerland

Glitch in user-level security for one user

Hi, all -



We have an mdb database used through Access 2007 and we have a user-level security process with it. One of my users (and only one, and she is my primary onsite administrator) is having a strange recurring situation where her account will disappear so she can't log in. Then, without doing anything, her account will seem to reappear so she can log on again - but but her Admin permission group has been removed, only the User group is there which has had all permissions removed. She gets the error about not having permission to open the Autoexec function. I have to go in and reassign her to to the Admin group.



Not sure why this is happening. She is the only one that this is happening to.



Has anyone out there experienced something like this?



Thanks.

Glitch in user-level security for one user

How do I force paste action to strip out any hidden characters?

My users do a fair bit of copy/paste from any number of sources.



How do I force the paste action to strip out any hidden characters? Now I realize that a return and a space are hidden characters, so how do I strip out everything but the ones that I want?

How do I force paste action to strip out any hidden characters?

Comparing One Record to Another

I have a situation that I hope can be done without using VBA.



Let's say table looks like this.



Name Type Amount Percent Bonus

John DCP 5000 10

John Sales 4000 5



I need to look at record one and if John's DCP Amount is >=4000 AND his Sales are >=4000 his Bonus amount for DCP would be 5000 * 10 and his Sales Bonus would be 4000 *5 but if the DCP was not >=4000 he would get no bonus for DCP and no bonus for Sales because DCP drives his bonus.



So even if Sales were >=4000 because DCP was not the result would be 0 for both. Make since?



Is there any way to evaluate this without using VBA?

Comparing One Record to Another

Attachment, HELP SQL Code for Union Query

Micrososft Access 2007



Having an issue with SQL code when four seperate queries are combined into one UNION QUERY to produce results in one datasheet.



The individual queries work. Please see attachement with code for individual query and for combined/union query.



Thank you for your time.




Attached Files





File Type: pdf FORUM Posted 2015 03 31.pdf (42.4 KB)



Attachment, HELP SQL Code for Union Query

Choose between test and live back end files

Hi,



I have a split accdb in Access 2010 with tables/data in the back end file (stored on a network drive) and the forms, queries and code in a front end file stored on each desktop. Note the front end file is common to two back end files. Both back ends will be mirrored but I need to use one for live data and the other for development and testing.



I want to be able to include vba code when the front end is launched that prompts the user to choose between one of two back end files, one 'test' and the other 'live'. But I've spent all afternoon scouring the net with no success on something simple but effective.



Can someone assist me with code that will do the following automatically please?



As I see it I just need an option on a form and depending on which is selected the following happens:



- links to current/existing tables are deleted

- chosen back end file (test or live) is selected (this has a password)

- links to the tables of the chosen file are created in the front end

- the appropriate back end source is now working with my front end



Help much appreciated.

Choose between test and live back end files

Removing a section of a string

Good Afternoon to people east of the USA Central Time Zone!



I have a workday headcount extract, and I mention Workday because their extracts suck! The extract comes out in only two choices, pdf or .xls



So I am copying and pasting the output into an access database to design the tables prior to porting them over to SQL Server 2012.



Workday merges different job classfications together, and I want to disambiguate them. So i have column 1 with two job classifications, each between 20 and 30 characters long, concatentated together. I have one of the job classes in column two

Goal: I would like to write an update query (maybe vba is required) to remove the string from column 2 whereever it exists in column 1 and put the remaining string result in column 3. the string to be removed may be anywhere in the first column, left right or in the middle.



I can't think of a good way to search for this, and I am busy with other quarter end reporting requirements. . . .



Thanks for any links or hints or conceptual structure anyone can provide.



BTW< ms access is a great starting point to then jump to SQL SERVER dba because of the similarities. . . but T-SQL is much better than MS SQL. . .





sportsguy

finance expert, SQL SERVER hack. . .

Removing a section of a string

HELP - Connnection Reset by Peer

Attempting to submit a new Thread/Post. Keep getting



"Connection Reset by Peer"



What's next?

HELP - Connnection Reset by Peer

Report Prints #Name? Instead Of Dates

I have a report that displays my "Start" and "End" dates correctly, but when I the report, the dates appear as #Name?. This happens on multiple printers. What is causing this ? The "Control Source" is as follows:



=[Form]! [Category_Totals_Form]! [StartDate]

Report Prints #Name? Instead Of Dates

Strange complicated Query

I am a newbie with only a few hours of training. I am trying to build a parameter query, where it will take a start month number from the Startup form. The start month (CD_StartM) is a ComboBox based on another query (qryForm_DateM). The end month (CD_EndM) is a ComboBox based on another query (qryForm_DateM). I wanted to have the ability to enter only the Start month and it give me all data points after and including that month, and I wanted to have the ability to enter only the End month and it give me all the data points before and including that month and I wanted to have the ability to enter a Start and End month and it give me all the data points between and including those months and the ability to enter no Start and End months and it give me all the data points.



I entered the following in the criteria box and it fails:

Between ([Forms]![frmStartup]![CD_StartM] Or [Forms]![frmStartup]![CD_StartM] Is Null) and ([Forms]![frmStartup]![CD_EndM] Or [Forms]![frmStartup]![CD_EndM] Is Null)



I also tried adding the # sign and it fails:

Between #([Forms]![frmStartup]![CD_StartM] Or [Forms]![frmStartup]![CD_StartM] Is Null)# and #([Forms]![frmStartup]![CD_EndM] Or [Forms]![frmStartup]![CD_EndM] Is Null)#



I am completely stumped. :banghead:

Strange complicated Query

Report prints too many pages

The report called "DraftCJP" in the attached database prints out on loads of pages, many blank, even though in Design View it looks like it is within the margins and it is in Landscape mode. In Print Preview without data it comes to 8 pages, when it should be 2 or 3.



I've tried various things but nothing seems to make sense. It contains subreports - can they be causing this?



Help appreciated. :)



thanks

James




Report prints too many pages

Hello from Illinois, USA

I am new to MS Access. I have had three days of class and then got thrown into a frying pan. We are wanting to use Access for the query and reporting portions. Found this site because I was looking and am completely stuck.



I will be asking questions very soon.



Thanks in advance for any help.



Tim

Hello from Illinois, USA

Updating Stock Quantites

I am relatively new to Access and am having to learn a lot on the job.



I have been asked to Create a "Stock Database"



This will be used by primarly 2 people, the storesperson and a sales person.



We need to to show Part number, description, quantity in stock, latest stock check (which i have added to a table called Stock List)



The storesperson will need to add stock to the database when goods are received, and adjust them out if anyone takes any items to use.



What is the best way of doing this? We want to track any movements in the stock so we can look back to previous adjustments if required



I thought of creating a new Table? With the Part Number (from look up of the table Stock List), Date/Time, Adjustment Type (booking in or taking stock out) and Quantity.



Is this the right way to do this? Then create a form based on this table?



I do not know how to adjust the stock ( + or - ) in the table Stock List based on the figures entered in the Stock transactions Table/Form.



Thanks in advance for your help.



Please advise if you need any more information.

Updating Stock Quantites

save listbox columns to table fields

What is the correct way to save the values in a listbox column to the fields of a table? I can use

rec("field1") = Me.list16.ItemData(Varitem)

and that records the bound column to field 1 but how can I save the unbound columns to other fields in the table?

save listbox columns to table fields

Copy paste excel file from Access VBA

Hi,



Have a requirement in which I'm really confused how to proceed.



All I need to do is copy an excel file from a location (while coping the file, the location of the source file remains same all the time)and paste that excel file where ever I want (Browser Option) from an Access VBA.



Request for your advise.



Thank you

Rakesh

Copy paste excel file from Access VBA

Been a while !!

Hello peeps (in the UK) !



It has been a while, since we met up. The last time we did was in London - September 2014. Wow, it has been 6 months already and I feel it is time we made the effort to meet up. I am sure some of us would agree. Last time, we did try to make the effort of asking people where they would like to meet and a convenient location. Have to be honest, it was not a great success. Although have to thank CJ_London, Uncle Gizmo, Isskint and bob fitz for making the effort to come over and share a few hours with us all. It was good to see them, would have been great if there were more than just 5 of us.



So I was thinking if people would like to meet up for a bank holiday weekend. Say, May 24 2015, Sunday noon-ish in Bristol? It would be nice to catch up.



So who is in? Any suggestions or comments?

Been a while !!

#NUM! Replacement

I have a form where the undelying query1 shows my customers and I have linked another query2 to show other data however where there is no data to show in Query2 it comes up with #NUM!



How do I get rid of this?

#NUM! Replacement

Importing Navigation Form between Access 2003 databases

When I import a form with the Navigation control on it The following attributes of the navigation buttons are changed to #FFFFFF:

Hover Color, Pressed Color, Hover Fore Color, Pressed Fore Color

I was hoping to be able to automate the updating of customers databases by sending them a database which would export the required objects rather than the whole front end database. I can think a way around this by including code in the form so that it changes the attributes to the desired values, which are:

Accent 1, Accent 1, Background 1 and Background 1. But I would rather not have to do that.

It is interesting to note that the Border Color attribute is not changed on importing. :banghead:

any ideas?

Importing Navigation Form between Access 2003 databases

Hello from mid Wales

I live in mid Wales, could not do it without the Internet, unless I wanted to be a farmer or tourism provider. Looking forward to contributing to the group.:)

Hello from mid Wales

Creating a lookup

Good afternoon,



I want to create a text box within a form that automatically populates a contact number based on a selection from a combo box, also in the same form.



For example, I have a Bidders Table (tblTenders), this form includes information regarding the Tendor like the company name and a main contact within that company and a phone number for that contact.



I've created a separate table for all the contacts called tblContacts. This table holds all the contact information for each contact. I have a simple form called frmTenders that asks the user to input the Customer (which is the company who are bidding) and the Main Contact, which is a combo box to select the main contact from tblContacts. Below that combo box is a text box called 'Contact Number' - I want this box to display the contact number for the main contact automatically when a main contact is selected from the combo box.



The contact number text box isn't storing that information in any tables etc. It's just for viewing purposes when we need to make a call to that specific tender.



Could someone offer some advice?



Many thanks,

Creating a lookup

Form will not save

Hi I'm getting an error message as shown in the screen shot I've been trying found where the error is in my relationship but just can't see it. I would love some one to take a look see for me




Attached Images





File Type: jpg Screen Shot 2015-03-30 at 12.51.55 pm.jpg (97.9 KB)


Attached Files





File Type: zip AppFurniture2.zip (155.8 KB)



Form will not save

On Lost Focus

i'm working on a database about employees and training programs that they need to go through before they go for on-field work. On employee form my boss wants that as soon as I enter Project # and employee Job Title, it automatically search from the other table the required trainings against the Project # and Job Title.



As I see, I need to check both fields on trigger On Lost Focus event whether they both are filled and then apply some kind of a query/macro to fill the Required Trainings field on the employee form.



How could I achieve that please??

Please avoid VBA because I don't understand it at these early stages, but I've started to understand Queries and Macros.



BTW: Can I use character string as a common field between two tables?? I don't feel a need of adding another field/ID just for the sake of relationship, plus my boss is not interested to enter an extra field in relationship table. I've Job Title column in common, that I could use for relationship in other table.



Thanks.

On Lost Focus

424 Error on Field to Word Doc Merge - Please Help

Hi,

Can anyone please point me in the right direction with the following code.

i am trying to take an Access 2010 Field values and merge into a formated Word 2010 document.

Error 424 occurs at the Red Highlighted Line.

Many Thanks in Advance.

Ron





Dim oApp As Object



'Path to the word document

LWordDoc = "C:\Cliik_Access_Database\Document Templates\PolicyCliik092014x.docx"



If Dir(LWordDoc) = "" Then

MsgBox "The Required Policy Document was not found, Please see IT Department to ensure document name and location are correct. In the event of a recent Policy Update these details may need amending within the database to reflect the new revision number. The current REVISION NUMBER IS 09/2014."



Else

'Create an instance of MS Word

Set oApp = CreateObject(Class:="Word.Application")

oApp.Visible = True



'Open the Document

oApp.Documents.Open FileName:=LWordDoc

End If

With doc

.FormFields("fldprem1").Result = Me!PREM1
.FormFields("fldprem2").Result = Me!PREM2

.FormFields("fldprem3").Result = Me!PREM3

.FormFields("fldprem4").Result = Me!PREM4

.FormFields("fldprem5").Result = Me!PREM5

.FormFields("fldprem6").Result = Me!PREM6

.FormFields("fldprem7").Result = Me!PREM7

.FormFields("fldprem8").Result = Me!PREM8

.FormFields("fldprem9").Result = Me!PREM9

.FormFields("fldprem10").Result = Me!PREM10

.FormFields("fldprem11").Result = Me!PREM11

.FormFields("fldprem12").Result = Me!PREM12

.FormFields("fldprem13").Result = Me!PREM13

.FormFields("fldprem14").Result = Me!PREM14

.FormFields("fldprem15").Result = Me!PREM15

.FormFields("fldprem16").Result = Me!PREM16

.FormFields("fldprem17").Result = Me!PREM17

.FormFields("fldprem18").Result = Me!PREM18

.FormFields("fldprem19").Result = Me!PREM19

.FormFields("fldprem20").Result = Me!PREM20

.FormFields("fldprem50").Result = Me!PREM50

.FormFields("fldprem52").Result = Me!PREM52

.FormFields("fldprem60").Result = Me!PREM60

.FormFields("fldprem100").Result = Me!PREM100

.FormFields("fldendorsements").Result = Me!Endorsements

.FormFields("fldinsurancepremiumtax").Result = Me!IPTotal

.FormFields("fldgrandtotal").Result = Me!GRANDTOTAL





.Visible = True

.Active

End With

Set doc = Nothing

Set appWord = Nothing







End Sub

424 Error on Field to Word Doc Merge - Please Help

Open form to specific record

Just a quickie.

Need to open a form to a specific record.

Ive done the command button wizard that opens the form to a specific record but but that brings up the form with the filtered button showing.



I've tried to put the formula into the filtered section but that doesn't work.



I just want to be able to open the form to the specif record and then be able to navigate to other records if required (without aving to press the filtered button)

Open form to specific record

Hello from London

Well, the weather here is pretty miserable at the moment. But I bring a warm hello from London. My name's Don and I'm just here to pick your well informed minds and solve a few issues. Hope to speak to some of you soon.

Hello from London

Query that shows price valid on specific date

Hi,

I am trying to make a query that shows the price for a product, based on two parameters.

Parameter one is a product code.

Parameter two is a date. This date falls between two dates.



I have one list (table) where is product code and invoice date.

The second list (table) I have, contains product code, and price valid from date, and price valid to date columns. This price valid to date is often not filled, and the price I still valid as we speak. If the date is filled there is often a new entry with an updated price. But sometimes, even if there is a new entry in the table, the date 'valid to date' is sometimes also not filled.



I would like Access to show me the valid price for the specific product. What criteria should I give in the macro, in order that Access shows what I want?



For illustration purposes, a small overview of my table:



Product code, Price, valid from, valid to

AAAA, 12000, 01.01.2012, 31.12.2012

BBBB, 16600, 01.01.2012, 12.06.2013

AAAA, 13500, 01.01.2013, 28.08.2013

AAAA, 11500, 29.08.2013,

BBBB, 17600, 13.06.2013,





Product, invoice date, price according to price list

AAAA, 02.05.2012, ????

AAAA, 01.08.2012, ????

BBBB, 10.06.2013, ????

AAAA, 31.10.2013, ????

AAAA, 16.11.2013, ????





I look forward to your ideas.

If you happen to know how this search can be performed in Excel, I am of course also happy to read that. (But my index, or Vlookup functions, give only the first possible result in the table. As I do not know how to give in the date parameter.)



Thank you so much in advance.

Query that shows price valid on specific date

Hi from Finland

lundi 30 mars 2015

Hi there, I'm Paul born and raised in the Netherlands, but now living in Finland. Currently I am learning how Access can make my work related tasks easier. I have already a nice basic knowledge about tables, fields, queries and expressions. But to make my work easier I can use some insider tips and tricks.

I look forward to learning from you!

Hi from Finland

Show hidden tabs based on Listbox Column Value

Hi,



I am designing a contact database for a diocese and the contacts record form is divided into several tabs, some of which are hidden by default. One of the controls on the form is a listbox (lboRoles), where a user can add one or more roles to contacts. The listbox has a hidden column that defines the TabIndex for the assigned role, and my goal is to make the associated tab on the form that was previously hidden, to now be visible.



For example, if a contact is assigned the role "Committee Member" and the tabindex value for that role is 3, the form should make the hidden tab (where the page index is also 3) now visible. Contacts can be assigned more than one role, so I'm trying to figure out the most efficient way to code this.



Any little nudge of guidance is appreciated!



Thanks,

Mike

Show hidden tabs based on Listbox Column Value

Query totals: Min

Hello All,



I am redesigning a database and there are some queries that use the Min total. I understand why you would use this for numeric fields, but I can't find anything online that explains why you would use Min for text fields. Is there any reason why you would or need to?



When I remove the MIN from text fields and run the query, I get a Project Coordination Center error that reads "You tried to execute a query that does no include the specified expression [FieldName] as part of an aggregate function." I take this to mean that if you use Totals for your query, every field needs a total type? Because THAT doesn't seem right...

Query totals: Min

Tables Versus Queries

Hello all,



I am redesigning an access database, but I have no formal training so I am not sure what it the best practice to use here. Currently, there is a new data entry form with a record source of a selection query. When new data is entered, it is split between two tables (the two that are being selected in the query). From there, this data takes on a snow ball effect, where the data is selected from tables and appended to other tables. The forms are based on queries based on queries based on tables. It all seems convoluted and takes a while to find your way back to the source to make any changes. This doesn't seem right, but like I said, I don't have formal training. It seems there are more tables then needed, since a lot of the tables have the same information.



So my question is, is there a reason why you would want to make a new table to house data as opposed to using a selection query to pull the data you want? Wouldn't it cause database bloat to have tables over queries?

Tables Versus Queries

Create new customer in Quickbooks

Hello all,



Looking for a way to fully integrate MS Access 2007/2010 with Quickbooks Enterprise Solutions. And I mean, fully integrate. It seems like most options I have found are import/export drivers with the occasional perk, but they all seem to lack something import.



Currently, I am trying to find a way to automatically enter a new customer, and create an invoice. Looking up the QODBC, it seems simple enough to generate the invoice BUT the big gotcha is the customer needs to be in quickbooks for this the work. So it seems I can do an import from Excel to Quickbooks to create this new customer, but is there a way to do this with VBA? Is there any way for MS Access to tell quickbooks to import a specific excel file, or am I reaching too far? Thank you!

Create new customer in Quickbooks

Bypass Access Message Box - Not In List

I have a combo box and a form on the List Items Edit Form property. When an item is entered that is not in the table, Access has a message box "The text you entered isn't an item in the list."



I would like to bypass this message box from Access and just have my form listed in the List Items Edit Form property to open.



I thought all I had to do was put code or a macro on the On Not In List event property and that would bypass the Access message box. However, my form does open but when I click close on the form, and then tab out of the field that was edited, I get the Access message box and I am in a loop.



What am I doing wrong?

Bypass Access Message Box - Not In List

Email to selected items in a combo box

I want to be able to e-mail the currently open report to a list of people using a combo box to select them. I want to add an "email" button to my reports, and have it open a form (see form attached).



Now, I have one table with the following columns:

Name, Email, Category, Office.



With the "Nombre" combo box, I want to be able to send it only to the selected people. With the "Categoria" combo box, I want to be able to send it to the people within the selected category(ies). With the "Oficina" combo box, I want to be able to send it to the people within the selected office(s).



I also only want to be able to use one combo box at a time.



Can someone guide me through how to do this? I need a dumbed version of a loop code to fill the "TO" field in the e-mail with the addresses of whoever's selected. I'm not very good with Access, and have looked everywhere. I've found some codes but have not been able to make use of them.




Attached Images





File Type: png stuff.png (42.9 KB)



Email to selected items in a combo box

text box location in form using VBA

I have one text box with the name of nametxt and one it's label with name of namelabel. I want to relocate this text box with it's label when the button02 is clicked to the new location. Thus i have tried using this code:


Code:



Private Sub Command02_Click()

nametxt.Top = 0.2083

nametxt.Left = 1.0833

namelabel.Top = 0.2083

namelabel.Left = 0.5833

End Sub



But this code is not working correctly and relocate the text box to the up left corner of form. How fix this issue.

I waiting for your help.

thanks,

text box location in form using VBA

Counter change

I have a table with RowId(autonumber),ReportMonth(date), SerialNumber(text), and Counter(number)



I'm trying to create a query that will eventually be a Make table query.



I want to show for each ReportMonth and each SerialNumber, the increase or decrease of the Counter.



Issue is that there might not be a SerialNumber and Counter every ReportMonth. Sometimes they may skip a month or a brand new SerialNumber may be entered so that record should show the current Counter.



I'm looking for ideas how to accomplish this,

Scott

Counter change

Aggregate Query HELP

I urgently need help in this I have attached a screenshot of the query I created to total points for each competitor and them I want the query to return only the highest for each agegroup. But I dont know how to do it. :banghead: :banghead::confused:




Attached Images





File Type: png query.png (9.0 KB)



Aggregate Query HELP

Class variable resets when adding new record in subform

Hi Guys



I am having a strange behavior.

I have a parent form which has a class variable (class module instance) to store the form' status and more.... and when i add a new record to the subform it resets the class variable field' data. but this only happens on first transaction, but if i re-run the steps (re-set the variable field value) it's not happening again. what could it be ?? an access bug ??



Thanks in Advance

Class variable resets when adding new record in subform

VBA Code work on computer A, but not computer B

I have code in place for sending emails when anyone enters a new record into my access database. This works fine from my local computer as well as another computer on our network. My problem is that its not working anywhere else.



All of the computers involved are running windows 7 (64 bit) machines. We are all running Office 2010 (32 bit version). I have one machine beside my local computer and have been comparing the setting of each machine to see what is different, and I have found nothing.



Like I said above, my local machine runs the scripts fine and the emails get sent, but the other machines keep getting the standard "runtime error -2147220973 (80040213) The transport failed to connect to the server" error. The database itself is stored on our windows 2008 server and everyone is accessing it from there on a as needed bases.



Has anyone else had this issue and if so how did you fix it? Any help or information would be greatly appreciated. :banghead:

VBA Code work on computer A, but not computer B

Queries with Check boxes?

I am very new to Access and was wondering if it is possible to create a Query where in I have the following:



If I have a checkbox in a form, and if that check box is checked can it be queried to find all records in which a checkbox is checked? I don't know if that is possible or I have to create some sort of macro or if I can just tell the query to find all the boxes that are checked as apposed to those that aren't.

Queries with Check boxes?

Hello from Utah, USA

Greetings all, my name is Mark and I'm a novice when it comes to Access 2010. I'm learning how powerful this program is and have been creating some simple Databases for work to help my life be just a bit easier. It's good to be here and can't wait to learn new things.

Hello from Utah, USA

Login form Security

Hello,



I have a login form which works perfectly fine.



Trouble is, i store the login details i.e. username and password in the employees table so technically other users who see this table will be able to login with that users login details..



Is there a way i can tacke this?



Also how do i restrict certain features of my database from users logged in?



The login directs users to the main menu which has buttons directing the user to all features available on the system, But i have dentists for example who should not have access to the registration form which receptionists use..



Another thing is one of the dentists is also the owner who has access to the entire systems features so if there is code involved here please could you bare that in mind:)



Any advice would be appreaciated :)



thank you

Login form Security

How to set the active window?

I have created a form that will print the active report. I have managed to make it look for the active report, but it won't find it because there's no report active, even though I have the report open. How do I make my report be active when I open it? (In a way that whichever report I open will become the active window so that my form will e-mail the report that is currently open)

How to set the active window?

How not to count duplicate records in report

I have a simple report which looks as given below:





ID Number Products

122 Cups

133 Pencils

122 Cups

133 Pencils



When I use the count function I get the total count of the record as 4

what I want is count the product varieties which should be 2



Thanks for your help



ps I am not that efficient in VBS:(

How not to count duplicate records in report

Set a date depending on a choice from a combo box / option buttons

Hi,



I'm looking to have either a combo box,, or 2 options buttons (whichever is easiest) that set a date field based on what is selected in the combo box/ option buttons.



The variables are 'Payment in 30 days" " Payment upfront"



if "payment in 30 days" is selected the date field on the form will enter the date as + 30 days from todays date

if "payment upfront" is selected the field on the form will enter todays date.



This date field must be blank unless an option is selected, as this information is only entered in a later stage of the form.



I've tried a few different ways to enter this but i can't quite get it to work as i want.

I hope someone can help me with this.



Thanks.



Ciaran

Set a date depending on a choice from a combo box / option buttons

Hello from qfillmart

I am an ameture access freak. I try to do different things with access and I always get help at this forum when I get stuck. So today I decied to join the group.



Thanks for your help.:D

Hello from qfillmart

Remove Item From Combobox

How can I remove an item after being selected from a combobox ?

Remove Item From Combobox

Freedom - ?

Shouldn't I be able to sell my goods to whom I please?



Link

Freedom - ?

Run query multiple times (different data parameter) to generate single dataset

Hi guys,



I have a reasonably complex query (3 subqueries into 1 main query) which gathers data from various tables into a single dataset based on a specified date.



I now need to generate a similar dataset but across a range of dates (a month) for reporting purposes. However, I can't just adapt the query and change the parameter from a "=#<Date>#" format to a "Between #<Date1># And #<Date2>#" format



The reason being, each date has to be treated individually and has to be queried as a standalone. It's to do with the type of data I have (one-to-many relationships between tables)



So what I really need to do is run the same query multiple times, for each date in scope, then stitch all of those datasets together into one 'giant' one.



But I have no idea how to do that in SQL (effectively, have one query produce the dates in scope, then join that onto the other query, passing each date as the parameter - I don't even think that's possible to be honest)



The other option I can think of is to use VBA to loop through the dates in scope, then use a QueryDef object to set the parameter and read the records for each date into a Recordset object. But then I have the problem of stitching all the Recordsets together, without looping through all the fields and rows each time.



I'm stumped - anybody have any suggestions? :banghead:



(Can post the SQL of the queries but it's quite large and didn't want to overload the thread - I'm just looking for a high-level approach!)



Thanks



Al

Run query multiple times (different data parameter) to generate single dataset

How to move the data from a table to another

Hi all Access Experts,



First of all, I am not a native english speaker, so please forgive me for my poor english.



My boss has assigned a task for me to move the details under a field name (eg:[Name]) in table 1 to table2 under another field name (eg:[InsuredName]).



Previously, the software I planned to use is Excel, but my boss says Excel cannot handle large data as the computer will be hanging.

So,he wants me to use Access to do the programming.

But I am definitely a newbie to Access.

I have some programming backgrounds (like C++) but it seems like I hardly understand how Access works! :banghead:

So can any Access expert here teach me how to do so that i won't get fired.



To get you the clear picture of what I want, I will paste some images here. I illustrate the process by using Excel but my job is making this work in Access.



Firstly, We will have the data like this.



Table1



Name PolicyNo Age Benefit

Chris 123 21 Death

Jane 456 34 TPD

Adam 789 55 DD



Secondly, we let the other staffs to key in which column to be mapped with the other.

Manually Key in (both columns)

Mapping Table:



Table1 Table2
Name InsuredName
Policy No Pol_No
Benefit InsuredBenefit
Age InsuredAge





Thirdly, the staff will run the VBA and result would be like this.



Table2
InsureName Pol_No InsuredBenefit InsuredAge
Chris 123 Death 21
Jane 456 TPD 34
Adam 789 DD 55



As you can see the new table(table2) , field number 3 is the same with the field number 4 in table1. There is something like copy and paste job, but user can decide how the arrangement for the new table is.



Any idea? I know this can be done in queries but as the boss wants it to be automated, what i can think of is VBA.



Appreciate if someone can help me on this. :confused:

How to move the data from a table to another

Update Parent form after subform updated?

Parent form/table, with a subform (separate table, 1:M link on "ID")

The parent form data stays fairly constant (occasional change/update), with multiple entries in the subform for each parent record which are added to more frequently

The master table has a field "last interaction" which I need to update whenever a new entry is made in the subform/subtable

It updates fine when I change an entry in the parent table/form, but not when I add a new subentry for that parent

Update Parent form after subform updated?

access 2010 vba help

hi,



i need help im new to access, vba, sql,... and need to adapt this:




Code:



Private Sub Project_Number_Click()

If Me.Town.Column(2) = "" Or Me.Type.Column(2) = "" Then

Me.Project_Number = ""

Else

Me.Project_Number = Me.Town.Column(2) & "-" & Me.Type.Column(2) & "-" & Me.Form.CurrentRecord

End If

End Sub



to actually check for which number to use for that type of project in that town.



so instead of "Me.Form.CurrentRecord"



it should check the "Towns" table where in the "Column(3)" line = "Me.Town.Column(2)" for column in that line = "Me.Type.Column(2)" and add +1



thanks for helping :)

access 2010 vba help

Rich Text Box

From a info sheet on RTB Using the Add, Clear, and Remove methods, you can dynamically populate the control with embedded objects at run time. Can those 'embedded objects' be controls, e.g. list boxes, labels etc ?

Rich Text Box

Reports Context Menu

dimanche 29 mars 2015

I cannot figure out how to cutomize my right click "Short-cut" menu in Access 2010. I need a right click menu with ONLY the "Print" and "Print Preview" options for my reports and I would like to disable right click in all other objects.



I can't use VBA yet. is there any other solution?

Reports Context Menu

Form/Textbox size

I'm attempting to emulate Excels pop-up comment on an Access Form.

My method for display is to set the textbox height and width to a known size then

DoCmd.MoveSize so the Form is the same dimensions as the text box.



I'm nearly there, Height is OK, but as I reduce the Form width the

textbox doesn't always stay in the right place. Even though

it's Left and Top are 0, it isn't visible. But if I increase the

Form width it returns to the 'right' place.



Has anyone got any ideas? Maybe there's a better way of doing this?



Thanks.

Form/Textbox size

compact remotely using batch

hi. Within batch file, I use the following command:

MSACCESS.EXE mymdbpath /compact



I get the exclusive in use error. How can I suppress such error or warning messages from within the batch file?.

compact remotely using batch

record wont display on report

hi,



my ive made a query to base my report off

the only issue is the ' timeslot' wont appear on the report://



the timeslot needs to be displayed on the time the customer booked their appointment...



can someone help me out please?



ive attached my query :(




Attached Images





File Type: png reporthelp.png (21.1 KB)



record wont display on report

2010 Questionairre tracking question

Hi all



First time poster here :)



I have a 14 point questionairre to use on 550 customers every 4 months. Ideally my boss would like me to be able to chart the changes in responses per person and per question. Is this relatively simple to do in Access? I'm a novice but confident I could put something simple together following youtube videos.



My other plan was to use an excel spreadsheet but it occurred to me that Access might be an easier option.



What do you guys think? Easier in Access or Excel? And if it's Access do you have any pointers? (videos etc)

2010 Questionairre tracking question

page and pages

hi,



I want to put my cost at the bottom of my last page in my report



is it possible to do a macro that says



if page =pages then text20 else "0"



steve

page and pages

Data Type mismatch fot text fiel when using datepart function incriteria

Hi I need urgent help. I have a query searching a database which stores the month and year in text. I use Monthname(DatePart("m", Date),False) to get the current month name and Datepart("yyyy", date) to get the current year for corresponding text fields. But the query gives a data type mismatch error. I tried using CStr(Monthname(DatePart("m", Date),False)) too :( PLS HELP :banghead:

Data Type mismatch fot text fiel when using datepart function incriteria

help with wild cards

Hi guys ,Im fairly new to access and Im currently making my first database. It is a simple database using tables ,queries forms and reports ,ive not advanced to codes yet.

Currently from the switch board there are options to search for items in the database based on different parameters .Once the box on the switch board is selected it opens another box asking you to fill in what you are looking for, then it returns results. All working ok except Im trying to add another search where it will return all variants of the searched for item. For example if I am searching for a part number 5106206 I want it to return all variants ie 5106206-10 ,5106206-02, 5106206-07 .I think this is done with wild cards but ive so far had no luck in getting it to work I am not sure if it is because in the query I am using the brackets ie[ enter product].

Great forum by the way

help with wild cards

Help with Airport Transfer Database

Hi All,



This is my first time using Access and i'm trying to make a airport transfer database for a family member. I have 3 tables Journeys,Drivers and Customers.All relationships are assigned and i've created forms for outbound and inbound journeys (all data is on one Journey table however). The problem I am having is that because outbound and inbound are all in the Journey table, once you assign a driver to the journey the driver is assigned to both outbound and inbound journeys (this however isnt always the case for the company). To fix it my best guess is that I will need to split the Journeys table into outbound and inbound tables, however I don't want 2 separate journeyIDs (primary key). Is there a way of connecting the two tables so that if I create an outbound journey it will have ID 1 then if it has a inbound journey this will have ID 2 (not 1 again becuase its the first inbound). Then the next booking made (on the outbound journey) will automatically have ID 3 (and not 2 because its the second outbound journey).



I hope i've explained it well enough and if you think im doing it completely the wrong way all advice would great :) thanks.

Help with Airport Transfer Database

hi everybody

Hi everybody .New to the forum .I have recently started using access and im hooked im in the middle of making my first database.

hi everybody

Find what has been added

Hi There,



I'd appreciate your help.



I need to find out what has been added to a table and then add that for each record I have in a stringed list called "lstTasks". This is the scenario.



I have a table of file links with multiple entries for TaskId.

As I enter a procedure I need to get a list of all file links for TaskId = 1

Then after the procedure does it's stuff I need to check all file links for TaskId = 1 again and if there are more records added, I need to add those records for each id in the stringed list "lstTasks"



Don't know if that makes sense, I'm rubbish at explaining what I need.

The tables are in MS Sql Server.



Thanks for any help you can give.



Best Regards,

Find what has been added

Hello form Thailand!

Hi there,



I am an experienced Access programer. But I am still an Access learner as well.

Currently I am living in Bangkok.



Mit

Hello form Thailand!

Calculate Next Monday

samedi 28 mars 2015

This code is used to calculate from Monday to the next Monday.

Starting with the closest Monday from today's StartDate in tblSchedules



The date could be Null if nothing has been scheduled, else start from the last StartDate and advance from there.



This is being used on a Continuous form.









tblSchedules

SchedID PK

StartDate Date/Time



Me.StartDate = DateAdd("ww", 1, Nz(DMax("StartDate", "tblSchedules"), Date)) The above code display this result 4/4

should be 3/30 next Closest Monday

Calculate Next Monday

prevent double booking

hello

As part of my query to prevent double booking i used the attachment (ignore the format and how wierd it looks ive blanked out some stuff to change the names haha)

My understanding of the query is this :

it will only show results based on the user, from the new form and it will also only show results based on date from the new form.



what i fail to understand is the time that is included in this query..

like with my understanding how does time involve in this all?



any help would would be appreciated :)

prevent double booking

Query Expression using sum of another calculated field in query

Hello. I've can do this on excel but don't know how in Access. I'm calculating bonuses. My table has salaries, and my query simply multiples each salary amount by a % to get the bonus amount. But I need to calculate adjustments to the bonuses using the sum total of the bonuses my query calculated:



Salary (from table) Bonus (calc'd by query) Adjustment (to be calced)



100,000 1,000 Sum of total bonuses/salary*4%

90,000 900



How do I capture the total of my calculated bonus column to use to calculate the adjustments in my right-most column?

Query Expression using sum of another calculated field in query

Strange NULL problem with a "Like" statement

Hi guys. I have a database with a table, a query and a form. tblCustomers, frmSearch and qrySearch. tblCustomers has [name] and [num]. frmSearch has three controls: two fields called [sname] and [snum] and a button that opens qrySearch. qrySearch has the same two fields as tblCustomers, but has their criteria set as follows (using [num] as an example):




Code:



Like "*" & [Forms]![frmSearch].[snum] & "*"


This allows me to return records even if I only type PART of the value of the field. For instance, I have a record with [name] set to "JONES", and if I go on frmSearch and type "JO" into [sname], Jones's record will show up on the query.



The problem is that, for some of the records in the table, I might not have a value in the [num] column, and those records won't show up if I leave [snum] blank (null). If I leave [sname] or [snum] blank, I want ALL the records, but if I type something, I want ONLY the records wherein any part of the column matches what I typed, and I DO NOT want the nulls.



I tried to modify the code to include the null values so that they all show up if I leave [snum] blank, like this:


Code:



Like "*" & [Forms]![frmSearch].[snum] & "*" Or Is Null


But then the problem is that the null ones show up when I type something into [snum]. For instance, I have four records, "Jones" with [snum] = "12345", "Smith" with [snum="67890", "Williams" with [snum]="5678" and "Thompson" with [snum] blank. If I use the first example and leave both fields blank, I don't see Thompson in the search results, but I want to. And if I use the second example and leave them blank, I see everybody, but if I type "5" into [snum], I get Jones, Williams and Thompson, but I only want to see Jones and Williams.



Can anybody tell me what I'm doing wrong? This has me stumped.



EDIT: Here's what I want, worded differently:



IF [sname] and [snum] are both null on frmSearch, return all records in tblCustomers with ANY name and ANY number, including all NULL values in either column.

IF [sname] is NOT null and [snum] is null, return all records where any part of [name] matches [sname] but NOT INCLUDING any NULL [name] records, and ALL [num] values including nulls.

IF [sname] is null but [sname] is NOT null, return all records of all names including nulls where any part of [num] matches [snum] but NOT INCLUDING null [snum] records.

IF [sname] and [snum] are BOTH NOT null, return ONLY those records where any part of [name] matches [sname] AND any part of [num] matches [snum] AND NEITHER [name] or [num] is null.

Strange NULL problem with a "Like" statement

Macro If statement

Hi Everyone,



I have a question, I have a macro that runs on a daily basis. I want to add a new action an If statement that will look at the Date and if its the 4th day of the month I want it to execute. If anyone can guide me on the right direction I would really appreciate it very much.



Thank you all

Macro If statement

problem input multiple tables from form

Hello,



I am building a form to create a user record and at the same time i have some yes/no options which are located in other tables but when i want add a user i cannot select any yes/no options they seem locked?



thanks in advance

problem input multiple tables from form

Subquery where subform is shared between 2 forms

There are 2 mainforms and both of them share a subform. This subform is an add subform and I want the mainform to be refreshed after the data entry.



Prior to the sharing, I had it coded it the way below and it works fine




Code:



Forms!frmMainformnoproc!frmActiveTasks.Requery


How would I recode this requery when it shared between 2 forms. frmMainformnoproc is the name of one of the main forms.



Any pointers in the correct direction would be appreciated.

Subquery where subform is shared between 2 forms

Subform edits

Hey...

A Quick issue..!!



i've got a Form that contains Subform with an embedded Query that contains 2 tables only (Payments & Invoices) the Join properties between them show all records from payments and what matches it from Invoices where the joined fields are equal (Invoice no).. So, when i enter certain data in the main form the Subform show the results for it from Payments table and only one field needed from the Invoices table !!



The problem is.. i can't edit or add any data in the Subform results with the previous setting, but when i completely remove the Invoices table from the embedded Query then swift to the Form and it's Subform.. i become able to edit and add data in the Subform easily... !!



So, how to enable the edit/add in the Subform with the 2 tables in the embedded Query ?! Cause it's really needed to show that field from the Invoices table.. :/



Here's a ScreenShot that may help in understanding..




Attached Images





File Type: jpg ScreenShot.jpg (98.0 KB)



Subform edits

Table input mask error

Hello,



I Have a field called appointment date and i have set the input mask as short date 00:00;0;_



the data type for the field is date/time but for some annoying reason this error message appear when i enter a date to the table... which for example is written like this 01/03/2003



so im not writing it in the wrong way



ive attached the msg below



Any help would b nice :)




Attached Images





File Type: png issue.png (3.5 KB)



Table input mask error

Date comparison query

I need to generate a query where I've a requirement to show all employees who have their training validity expired once we compare the Completion Date field in one table with ValidityYears (validation on certificate in years) of training in another table.



Attaching relationship screenshot, when I try to use DateDiff function in expression builder as:



IIf((DateDiff("yyyy",[tblEmployeeTrainings]![CompletionDate],Date())>=[tblWorkTrainings]![ValidityYears]),1,0)



It gives correct result when it compare to years, but it can't compare months and days. for example completion date of certificate was at April 30, 2014. If it compare it with current date it should show me false part of IIf because it still has over a month left in expiry from now, but it shows me true because query is comparing only years. I've spent several hours but could not figure out.



How should i rewrite the query in expression builder so that i compare to the months and days level PLEASE?



Thanks.




Attached Images





File Type: jpg CertificateExpiry.JPG (25.7 KB)



Date comparison query

[SOLVED] Delete record problem

I have a form that works just fine, however I need to add a 'delete record' command button.



Now, the delete record bit works just fine, and the next line in the code is to close the form - again, this works, however when I then look at the table after the form has closed, the record has been deleted and then a new record has been created. I believe that this is as a result of the On Current events on the form, which are there to save certain items to the table when the form is opened or altered.



Is there a way to delete a record, and then force the closure of the form without allowing the form to become current once more?

[SOLVED] Delete record problem

Table Confused :(

Hello,



I really need help and im so stressed out i cant understand.



Ok so im doing a project and i made a requirement spec of which has this:



must store appointment ID, customer ID, forename, surname, contact number, dentist ID, forename, surname, room, appointment date and time...





what this means is when a new appointment is made which asks for the details above then these details will be stored... in the appointments table..



BUT :( my issue is my appointments table does not have forename, surname ( for both the customer and dentist) or the contact number....



So i dont know how i will justify that those listed will be stored from the new appontment because all that is stored is appointment ID, customer ID, dentist ID, room, appointment date and time...



because if i cant then my issue is why did we ask for those details in the new appointment (i needed them to identify the customer if the ID was forgotten)



IM SO STUCK :(





please if anyone understand could you help me out :(



THank you

Table Confused :(

Question access query

I have a main menu and ribbon is hidden, when you open a report what code can you use to shut the report and it returns to the main menu, at the moment when you close it, it closes the database

Question access query

Update query percentage prompt

Hi I need to do a update query with prompt to input a percentage.

Update query percentage prompt

Finding Mouse Coordinates

vendredi 27 mars 2015

Hi, I have an Access 2007 continuous view Form and would like to capture the mouse X=-Y coordinates to set the start up position for a small Form.



I hoped to use MouseMove method, but this does not work.



Any help with this very much appreciated.

Finding Mouse Coordinates

page break

hi,



is it possible to force a page break after 15 line items



thanks

steve

page break

formula in report

hi

I want to be able to sum my net amount and other costs in my page footer



but it is error

why would this error in the page footer



=Sum([net amount])



thanks

steve

formula in report

hello from california

Hi, I'm kinda new here. By "kinda" I mean that I have visited the site many times in the past to read other posts and have found it to be a good reference. I have an AS degree in Computer Info Systems. I worked with Access a lot in the past, at which time you could say I was at an intermediate level with it. But it's been a while and I'm quite rusty. I recently took on a database project for work that I am doing "on my own time" because I thought it would be something fun to do. Now, I realized I must have been out of my mind. Really, what was I thinking? :banghead:



So, I'm off to find the area where I should post my SOS message. :)

hello from california

Question about tables

Hello,

I wil introduce myself i am a dutch student. At the moment i am working on a database but i ran into a problem that i can't get my head around.

Lets say i have 3 tables

Table 1 : Has students in it

Table 2 : Has their groups

Table 3 : Has their classes they follow.



Now i want i want to create a query. Which connects a student with a group and then shows me all the classes he has to attend to.

So lets say i have a search form (which i created) i search for the student (i can get this far) then i want it to show me the groups he/she is in and to show me the classes he/she follows per group.



Thanks in advance and sorry for my bad english:rolleyes:

Question about tables

SubForm

Hi,



I am trying to design a subform to allow multiple records to be entered and then uploaded to a table. I've designed the subform but it is currently pulling all of the records from the table through and all I want is a blank subform for data entry.



I have tried putting a macro in the On Load and On Open events to get it to go to a new record but I keep getting error number 2046. Can anyone help please?

SubForm

List box row source queries

If I have a form with multiple list boxes, lets say named 10, 20 and 30.

and multiple text fields called 15,25,and 35. Now I want to get a value in the list box based on the text box value so I make row source queries that looks like this.



SELECT [table].field1,[table1].field2 FROM [table1] WHERE ((([table1].field2)=[Forms]![form1]![15]));



SELECT [table].field1,[table1].field2 FROM [table1] WHERE ((([table1].field2)=[Forms]![form1]![25]));



SELECT [table].field1,[table1].field2 FROM [table1] WHERE ((([table1].field2)=[Forms]![form1]![35]));







So now my question... Is it possible to make one query that picks up the 15,25 or 35 depending on wether it is being queried from 10, 20, or 35. The difference in name is always the same except for the first number so could it be made to reference where it is asked from?

List box row source queries

good forum for angularjs

Hi,



i'm looking for a great forum about angularjs except the google group.



Any idea ?



thx

good forum for angularjs

Windows 8.1 freezes at starting

Hello,



i was wondering if someone has the same issue as me.

sometimes and without any reason, Win8.1 freeze at boot, while seeing the blue/green windows logo.



I checked in the windows event logs but i saw nothing special.



thx.

Windows 8.1 freezes at starting

I need help!!

Hi folks



I have been using access for about 10 years and have muddled my way through using wizards and web sites.

I am currently building a DB for my Partners business and for the first time am involving the financial aspect of the business. EEEK! Im getting stuck a lot and could do with an expert.



Hope you can all help.



Nic

I need help!!

Show the lock status of a record with VBA

HI,



I have a form and I want show a message on the form when the it is locked as another user is editing the data in a particular record.

I know the record selectors show the records lock status but it a very tiny symbol which will mean nothing to the users of the database and anyway I don't want record selector bar on the form.

Can any one help me with how I would do this??? :confused:

Show the lock status of a record with VBA

Progress Bar not accurate

Hi,



I'm making a code to run a Progress Bar from different forms and as per their conditions.



Have two forms:

1- Form1="frmProgressMeter"

2- Form2="frmDatabaseStwitcher"

3- Module1=for Functions



On frmDatabaseStwitcher, the code for Progress Bar is:

-----------

Option Compare Database

Option Explicit

Private Declare Sub sapiSleep Lib "kernel32" _

Alias "Sleep" _

(ByVal dwMilliseconds As Long)



Sub OpenProgressBar(nTopLimit As Long, strCaption As String)

If nTopLimit > 0 Then

DoCmd.OpenForm "FrmProgressMeter", OpenArgs:=strCaption

Forms("FrmProgressMeter").TopLimit = nTopLimit

End If

End Sub



Function SetProgressBar(nCurrent_Pos As Long) As Long

If IsLoaded("FrmProgressMeter") Then

Forms("FrmProgressMeter").Current_pos = nCurrent_Pos

SetProgressBar = Forms("FrmProgressMeter").Current_pos()

End If

End Function



Sub CloseProgressBar()

If IsLoaded("FrmProgressMeter") Then

Forms("FrmProgressMeter").CloseMe

End If

End Sub



Sub sSleep(lngMilliSec As Long)

If lngM

illiSec > 0 Then

Call sapiSleep(lngMilliSec)

End If

End Sub



------------



Code to run Progress Bar with Condition is:



----------

Private Sub cmdDisconnect_Click()

On Error GoTo Err_cmdDisconnect_Click



Dim dbs As DAO.Database

Dim tdf As DAO.TableDef

Dim strDatabaseName As String

Dim File As String

Dim retval

Dim NOS As Long 'No of steps

Dim n As Long 'Total Steps



Set dbs = CurrentDb()

File = "Data" & Format(StartDate, "yy") & Format(EndDate, "yy") & ".accdb" '(Output = Data1516.accdb)

strDatabaseName = Folderpath & "\" & File



Me.lblStatus.Caption = "Connecting to current database. Please wait..."

DoCmd.Hourglass True

Me.CmdClose.Enabled = False

Me.cmdConnect.Enabled = False

Me.Dbase.Enabled = False

Me.CmdDisconnect.Enabled = False

retval = SysCmd(acSysCmdSetStatus, "Connecting to current database")



OpenProgressBar 100, "Completed"



NOS = dbs.TableDefs.count

For n = 1 To 100

sSleep 10

SetProgressBar n + NOS

Next n


For Each tdf In dbs.TableDefs

If tdf.Connect <> "" Then

tdf.Connect = ";DATABA

SE=" & strDatabaseName & (";PWD=zujan")

tdf.RefreshLink

End If



SetProgressBar n + NOS
Next tdf

sSleep 1000

CloseProgressBar



Me.lblStatus.Caption = "Done."

DoCmd.Hourglass False

retval = SysCmd(acSysCmdClearStatus)



MsgBox "The Auto Evolution database is now connected with " & _

"'" & File & "'.", vbInformation, "Connection Successful"

DoCmd.Close acForm, Me.NAME



Exit_cmdDisconnect_Click:

Exit Sub



Err_cmdDisconnect_Click:



DoCmd.Hourglass False

If Err.Number <> 2467 Then

MsgBox ("Unable to execute database switch now."), vbCritical, "Error"

Me.CmdClose.Enabled = True

Me.cmdConnect.Enabled = True

Me.Dbase.Enabled = True

Me.CmdDisconnect.Enabled = True

Resume Exit_cmdDisconnect_Click

End If

End Sub

Progress Bar not accurate

Date()-3 **but** exclude weekends

Hey, all. I'm looking for a little bit of help. I need to run a query that will look for all data from before three days prior to today. All data gets an automatic 72 hour lag, but only business days count to this.



For instance, running Date()-3 on Tuesday would not exclude data from Friday or Thursday: but I need it to do so.



I tried following and tweaking the instructions here:

thread: t=193459 (can't post links yet)



But was unable to make that work properly.



My thought process was to use the Criteria field to restrict the days something like: Date()-3 if and only if date() is thurs, fri. Date()-5 if and only if date() is wed, tues. Date()-5 if and only if date() is tues. Date ()-6 if and only if date() is mon.



Thoughts on making this work?

Date()-3 **but** exclude weekends

Greetings!

Hi folks, new member. Hoping to lean a bit about Access, and troubleshoot some problems that are occurring in my work. I think the issue is located between the keyboard and the chair. More as this develops. (:



Thanks.

Greetings!

Update value from form

Hi. I have 2 forms: Form_1 and Form_2. In each on them I have a 2 Fields named ID. I need when I open Form 2 to update the field ID with number from field ID, Form_1. Can you help me?

Update value from form

Correlated query to find cheapest manufacturer

Hi,



I have a SQL Query that returns me:

- the "product code" i must purchase,

- the "quantity" to purchase for this product

- and if it's in "promotion or not".



Based on this result, i must to look at "manufacturer" table and find the cheapest "price" for each product to purchase and the quantity available at the manufacturer.

If "quantity to order" (e.g. 20) is higher than "quantity available" (e.g. 12) at "cheapest manufacturer", i must order the missing quantity (8) to the next cheapest manufacturer.

How can i do that ?



thx

Correlated query to find cheapest manufacturer

Progress Bar not accurate

Hi,



I'm making a code to run a Progress Bar from different forms and as per their conditions.



Have two forms:

1- Form1="frmProgressMeter"

2- Form2="frmDatabaseStwitcher"

3- Module1=for Functions



On frmDatabaseStwitcher, the code for Progress Bar is:

-----------

Option Compare Database

Option Explicit

Private Declare Sub sapiSleep Lib "kernel32" _

Alias "Sleep" _

(ByVal dwMilliseconds As Long)



Sub OpenProgressBar(nTopLimit As Long, strCaption As String)

If nTopLimit > 0 Then

DoCmd.OpenForm "FrmProgressMeter", OpenArgs:=strCaption

Forms("FrmProgressMeter").TopLimit = nTopLimit

End If

End Sub



Function SetProgressBar(nCurrent_Pos As Long) As Long

If IsLoaded("FrmProgressMeter") Then

Forms("FrmProgressMeter").Current_pos = nCurrent_Pos

SetProgressBar = Forms("FrmProgressMeter").Current_pos()

End If

End Function



Sub CloseProgressBar()

If IsLoaded("FrmProgressMeter") Then

Forms("FrmProgressMeter").CloseMe

End If

End Sub



Sub sSleep(lngMilliSec As Long)

If lngM

illiSec > 0 Then

Call sapiSleep(lngMilliSec)

End If

End Sub



------------



Code to run Progress Bar with Condition is:



----------

Private Sub cmdDisconnect_Click()

On Error GoTo Err_cmdDisconnect_Click



Dim dbs As DAO.Database

Dim tdf As DAO.TableDef

Dim strDatabaseName As String

Dim File As String

Dim retval

Dim NOS As Long 'No of steps

Dim n As Long 'Total Steps



Set dbs = CurrentDb()

File = "Data" & Format(StartDate, "yy") & Format(EndDate, "yy") & ".accdb" '(Output = Data1516.accdb)

strDatabaseName = Folderpath & "\" & File



Me.lblStatus.Caption = "Connecting to current database. Please wait..."

DoCmd.Hourglass True

Me.CmdClose.Enabled = False

Me.cmdConnect.Enabled = False

Me.Dbase.Enabled = False

Me.CmdDisconnect.Enabled = False

retval = SysCmd(acSysCmdSetStatus, "Connecting to current database")



OpenProgressBar 100, "Completed"



NOS = dbs.TableDefs.count

For n = 1 To 100

sSleep 10

SetProgressBar n + NOS

Next n


For Each tdf In dbs.TableDefs

If tdf.Connect <> "" Then

tdf.Connect = ";DATABA

SE=" & strDatabaseName & (";PWD=zujan")

tdf.RefreshLink

End If



SetProgressBar n + NOS
Next tdf

sSleep 1000

CloseProgressBar



Me.lblStatus.Caption = "Done."

DoCmd.Hourglass False

retval = SysCmd(acSysCmdClearStatus)



MsgBox "The Auto Evolution database is now connected with " & _

"'" & File & "'.", vbInformation, "Connection Successful"

DoCmd.Close acForm, Me.NAME



Exit_cmdDisconnect_Click:

Exit Sub



Err_cmdDisconnect_Click:



DoCmd.Hourglass False

If Err.Number <> 2467 Then

MsgBox ("Unable to execute database switch now."), vbCritical, "Error"

Me.CmdClose.Enabled = True

Me.cmdConnect.Enabled = True

Me.Dbase.Enabled = True

Me.CmdDisconnect.Enabled = True

Resume Exit_cmdDisconnect_Click

End If

End Sub

-------------



Problem:



This code is working in two ways:



If I go with "SetProgressBar n / NOS" then progress bar shows 2% and then connecting process time.

Or

If I go with "SetProgressBar n + NOS" then progress works till 100% but then connecting process time.

Also

SetProgressBar (n / NOS) * 100 but then connecting process time.



Any assistance will be appreciable.

Progress Bar not accurate

If Statements in MS Access Tables

Hi, I am creating a Database and I am baffled how to make the following If Statement Work in a table. =IIf(IsNull([Sold Date]),Date()-[Listing Date],[Sold Date]-[Listing Date])



I want to count the number of days between the list date and sale date, but if the sale date is blank, I want to calculate it from todays date. The problem is that MS Access gives me an error that this formula cannot be used in a calculated table. Any ideas.

If Statements in MS Access Tables

New poster/old person

Hi



I'm Karyn & I've worked with databases in a previous job but am dusting off my skills as part of my new post in the NHS.



Look forward to posting some problems and solving some as well :D

New poster/old person

Showing unlinked data.

I have three tables.

The first is my table of pupils which is linked to the second table: a list of awards and a score 1-5

My third table is the list of 10 awards.



My problem is that (in my report) I want to show all 10 awards for each pupil regardless of if they have achieved them. I'm struggling with the underlying query to always show all 10 awards.



So, little Johnny has achieved a score of 5 in two of the awards, however the report card will show blanks for the remaining awards on his report.

Showing unlinked data.

delete Query

jeudi 26 mars 2015

delete Query

How do i Specify the table containing the records that I want to delete?

delete Query

Code for Date Picker Use AND User Date Entry

I have a textbox on my form that is for "week of", always a Monday. There is vba to populate the appropriate Monday when the user selects something other than Monday via the date picker. This code is in the on change event. However, this is not friendly to a user entering a date in this field.

  • I did try after update event, but that requires user to leave the "week of" field. This is not acceptable in this instance, there are other form fields that change as a result of this "week of" value.

  • I also tried evaluating the length of the text or else exiting the code. However, I was expecting the date being returned from the date picker to always be 10 positions, but for March 3rd, it would return 3/3/2015...which is only 8 positions.


Any help or related info. is very much appreciated!!

Code for Date Picker Use AND User Date Entry

Split/Sub Forms

I'm trying to use sub-forms in split-forms mode, where main form displays one record and sub-form displays all the relevant records same exactly as in case of split-forms, but sub-form displays only one record.



What should i do to bring the split-forms type functionality in sub-forms?? i've linked the main form with sub form using tag number value.

I'm not using split-forms itself because it doesn't listen to size coordinates and always appears big and often bigger than the screen coordinates when i set pop up property to yes.



Thanks

Split/Sub Forms

what does this mean?

Heya could someone please explain this query to me in depth?



i know its an update query that signs a user in when they have a booking



but i dont really know how i would explain it in depth..



any help would be lovely:)



thank you




Attached Images





File Type: png bookingqry.png (6.4 KB)



what does this mean?

Compile different database name

I made a copy of my database named Stores and named it as Purchasing.

I did this as they are basically identical except Purchasing has some other tables, forms, etc...



When I click on the Debug/ Compile it says Compile Stores, is there a way to change this so it says Compile Purchasing.



Without having to create a new database and import everything.

Compile different database name

Sum() adding 1 to the overall result?

This is bizzare.



I have a report...with one number at the end of a line, beneath is a sum() of all the numbers above.



To test this report, I have ensured there is just one line to 'sum' ....this particular number happens to be $15.82, yet the field showing the sum of this is displaying $15.83 ...I'm going potty here trying to work out where the extra 1 is being added...it's not a rounding error as there are no further decimals involved, both fields are set to 'fixed' 2 decimal places.



Any ideas?!!!!!

Sum() adding 1 to the overall result?

select query return "text" instead of "boolean value"

Hello,



it's been a long time since i did some SQL queries on MS Access, but i forgot how to do to return a text for each row (as field value) when a table field contains "1" as value ?

for example i have a table named "products" with a field/column called "promotion". Sometime a product is promotional, so in this case, the "promo" column holds "1" as value.



during a select on products table, how can i do to return "in promotion" (e.g.) if the column "promo" holds "1" for a product ?



thx.

select query return "text" instead of "boolean value"

Remote Data to be collated

I have 4 sites one of which is head Office. Each has a Database that records among other stuff the hours an employee works. Roughly 10 per site.



One site is the Head Office where the payroll is processed.



I want to get the Data contained in the table Employee times and send them to HO so that they can be uploaded into the main Database which is essentially the same as the others.



All sites have internet access but they are not connected in any way.



Does anyone have a suggestion on how I should move this data about.

Remote Data to be collated

Capture picture from webcam

Hi,



I am developing a Student Database that shall capture Biometric and Pictures.

I got the fingerprint on an access form. However I cannot get image directly from the webcam to an access form. I have to use the manufacturer's software to capture the image before importing to access using .picture property.



Is there any way of capturing the image directly from the cam to an access form?:banghead::(

Capture picture from webcam

Labels