Hello maybe you can help me, I have made a Vba code (see below), what do I want to do now, I want to work with yes/no if I say "no" nothing happens goes back to worksheet "Menu" cell "E2"; if "yes" then the selection is cleared, I do want to be asked if I am sure. Can you help me? Here is the code: Sub New() ' ' New Macro ' Application.ScreenUpdating = False If Range("E2") = 2 Then Sheets(Array("S1", "S2")).Select Sheets(Array("S1", "S2")).Select Sheets("S1").Activate Range("C3:E21").Select Range("H3:J21").Select Range("M3:O21").Select Range("R3:T21").Select Range("W3:Y21").Select Range("AB3:AD21").Select Range("AG3:AI21").Select Range("AL3:AN21").Select Range("AQ3:AS21").Select Range("AV3:AX21").Select Range("BA3:BC21").Select Range("BF3:BH21").Select Range("BK3:BM21").Select Range("BP3:BR21").Select Range("BU3:BW21").Select Range("BZ3:CB21").Select Range("CE3:CG21").Select Range("CJ3:CL21").Select Range("CO3:CQ21").Select Range("CT3:CV21").Select Selection.ClearContents Sheets("Menu").Select Range("E2").Select End If Application.ScreenUpdating = True End Sub
@LoeblComServicesАй бұрын
Hi, you can test the value of the dropdown list. If it's "no" then activate cell Menu!E2
@gerardvaneggermond2067Ай бұрын
@@LoeblComServices Hello, what if I answer yes? Can you give me an example for my code? both yes and no? Thank you
@steventaylor60573 ай бұрын
Another useless video. If you are going to explain how something works. don't stick it in a used database.
@ryccahilser62994 ай бұрын
🤗 'promo sm'
@amandaphillips8605 Жыл бұрын
Hi Eric... Just found your video. I'm basically self taught in access, so writing code is a struggle. I was hoping maybe you could help me an issue I can't get passed. I have a main form (named Primary Form) and a subform (named service request). I finally figured out cascading combo boxes (if I choose PH in one combo box, I see cardiology, endocrinology, etc.) in the next combo box; if I choose BH, I see psychology, psychiatry, etc.). The combo boxes are located on the service request form. My primary form contains the agency name, contact name, email and auto ID. When I dropped my subform into the main form, it will not allow me to add new agencies. I'm sure the issue is in writing the code in the primary form. Do you have any ideas why these two forms aren't in sync?
@LoeblComServices Жыл бұрын
Not being able to add data is normally a result of bad data relationships. If you want, you can send me a copy of your database, and I can possibly help out a bit more. erik [at] loeblcomservices.com
@cibertecusinc7924 Жыл бұрын
Bravo No podia hacer la conecion, utilizando ADO y este metodo me parececio excelete con DAO Saludos desde Mexico
@LoeblComServices Жыл бұрын
Gracicas, DAO es bueno tambien. Queda se bien, saludos!
@thomhaasert9000 Жыл бұрын
HI @loeblomServices, your site is not working anymore (got a 404 error). I almost copied your entire sub of the screen but I am missing a part. can you send me the full sub? kind regards!
@LoeblComServices Жыл бұрын
Hi Thom, thanks for the heads up. The link is working now
@rakeshdevanaboyina1850 Жыл бұрын
i am getting error sub or function not define
@LoeblComServices Жыл бұрын
What is the text of line your code erroring at? Sounds like a sub procedure is not defined so you are getting an error.
@patriciohernandezballester2485 Жыл бұрын
how to do the same with excel?
@LoeblComServices Жыл бұрын
Good question, I'll have to put an example together and let you know.
@emadabuhagag2222 жыл бұрын
Thanks
@LoeblComServices2 жыл бұрын
Glad to help
@chamseddinebedhiaf53842 жыл бұрын
Thank you very much for the video !
@hermanbroeckx83292 жыл бұрын
Erik, in Europe not every email address ends with ".com". Is there another solution to solve that problem?
@LoeblComServices2 жыл бұрын
Hi, just replace the line of the If statement to "If Instr(1,email_address, ".de") Then IsEm....
@samsylv10702 жыл бұрын
can I please get the workbook
@LoeblComServices2 жыл бұрын
Hi, I will fix the link so you can get the workbook
@LAILAHUSSEIN2 жыл бұрын
can I import/connect to an existing MySQL database
@chaeloooo2 жыл бұрын
link is noy working
@LoeblComServices2 жыл бұрын
Thanks for making me aware of this. It's fixed now
@chaeloooo2 жыл бұрын
@@LoeblComServices thank you for the tutorial it help me a lot.
@LoeblComServices2 жыл бұрын
@@chaeloooo I'm glad it helped
@maneeshmassey2 жыл бұрын
How do you hide unhide subforms with a combo box selection?
@LoeblComServices2 жыл бұрын
You can add an "AfterUpdate" event on the combo box to set the [subformname].visible=True or [subformname].Visible=false
@PiyushMedicalKnowledge2 жыл бұрын
Make the same video on excel
@LoeblComServices2 жыл бұрын
For better direction with the video, what will trigger the message box in the Excel sheet?
@satyabanukil7792 жыл бұрын
How to open a form with a specific record through a parameter
@JiangMichael3 жыл бұрын
Hi Erik, I have 2 combo boxes cbo1 and cbo2, they bonded with tableA field heading, I need to create a calculated field in the report as Var=cob1-cob2. how can do that? Thanks, Jess
@factopedia10543 жыл бұрын
Great ✌️
@bondniko3 жыл бұрын
Well, not a Chrysostom, but ....
@sureshbabu-nj2vt3 жыл бұрын
Amen!!!
@malcolmlarkin54733 жыл бұрын
how would i go about looping the code through the whole sheet i.e all of column A to return value in column C
@purplemist81293 жыл бұрын
Amen 🙏
@gochocitizen3 жыл бұрын
If anybody here is doing Access and/or VBA, in any capacity, I highly recommend Erik’s channel. It has all kinds of information!
@gochocitizen3 жыл бұрын
Erik, could you please show us the entire statement you used to display the date range on the reports header? We only see the first part of the statement on 10:25 Thank you, again.
@@LoeblComServices, thank you! I subscribed to your channel. If anybody here is doing Access, in any capacity, I highly recommend Erik’s channel. It has all kinds of information!
@gochocitizen3 жыл бұрын
Hey man, I got it to work perfectly, thanks to you! I really appreciate it. I'd love to know how you were able to read the params twice by setting the Visible property = False
@gochocitizen3 жыл бұрын
I think I got it. You don't close the params dialog form after the report is generated, previewed it, and even printed. You just get it out of the way by making it invisible. You only close it when you're done done with the report. By keeping it opened, you get to use the user-inputted dates as you wish. Cool!
@gochocitizen3 жыл бұрын
Awesome video. Thank you. I’m going to try it on my reports. I like your approach as the prompt artifacts are detached and can be used for other forms.
@rafaelsantana58083 жыл бұрын
Thanks for the help. question: how can I add a calculated field to speech using your code? I'm new
@LoeblComServices3 жыл бұрын
Hi Rafael, I wouldn't recommend adding a calculated field in your table (even though modern versions of Access allow it). I would suggest that you add the calculated field to a query (vbahowto.com/qbe-query-by-example-grid-calculated-field/).
@pasqualinatartaglione11773 жыл бұрын
you're a LIFE SAVER MAN!!!!
@LoeblComServices3 жыл бұрын
Glad to help
@many0013 жыл бұрын
what about if i have 2 or more conditions how i write them in vba? with example please :) thx
@Larwai3 жыл бұрын
Hey, I could not see anything in advance. You used just a simple parameter.
@kelitonandre47383 жыл бұрын
This class is very good. How can I edit the types of fields within that same code? As I see it, this code creates the table and inserts the column names, but it does not say the types of data that will be stored in those columns.
@kelitonandre47383 жыл бұрын
This class is very good. How can I edit the types of fields within that same code? As I see it, this code creates the table and inserts the column names, but it does not say the types of data that will be stored in those columns.
@chilansethuge84873 жыл бұрын
Extremely powerful idea, was looking for this everywhere. One seperate note, I would ask everybody to be respectful when giving feedback because a person is less likely to share their "know how" if we say stuff like " random mumbling"...nobody is perfect...
@LoeblComServices3 жыл бұрын
I'm glad you found it helpful. Thanks
@sirrarethecrackhaed73503 жыл бұрын
thanks for the tutorial man
@4techsolutions1493 жыл бұрын
Sir I need a code behind the button
@LoeblComServices3 жыл бұрын
Hi, you can get the code here: vbahowto.com/passing-form-field-default-values/
@andersferm79073 жыл бұрын
@LoeblComServices Thank you! Your video has been very helpful. I like to do a concartenation of two values in the select statment. But I have not fond how. Example: strSQL = "SELECT Id, Name & ", " & Value AS Attribute, Configuration FROM parties_Attribute WHERE Configuration = " Me.Configuration. Its the Name & ", " & Value AS Attribute part that I didnt solve. Is there solution to make this kind of concartenation in the SQL-statment?
@kensimba78683 жыл бұрын
Good tutorials but were u tipsy??
@johnsmith2473 жыл бұрын
It's always the darn quotation marks that screw me up. Thanks.
@LoeblComServices3 жыл бұрын
True
@primuncakproperties80273 жыл бұрын
Thank you!!! It helps me Aaaaa lot!! Sorry, may i know how to print this filtered result..? :D
@LoeblComServices3 жыл бұрын
Hi, thanks for the question. You can either copy the results and paste them into Excel to print, or right click the form in Access and click print, or make an Access report with the SQL string to print out.
@musebshaikh76173 жыл бұрын
*Automatically Resetting the Value of Invoice no to 1 whenever new month starts and updating the customer ID as per new invoice no.* *different cell and it's data* "A2" is Date in "dd-mm-yyyy" "B2" is Year - *Year("A2")* C2 is last two digits of the year "20" - *Right("B2",2)* D2 is my month "04" - *Month("A2")* and E2 cell is my invoice no. F2 cell is my customer ID. Range("E2").value = Range("C2"). text & Range("D2").text & Range("E2"). text Range("F2").value = "C" & Range("E2"). value Suppose, I am working for January. then I need my invoice Number to increase by 1 for each new invoice. after that if the month changes to February then again my invoice Number should start from 1 and get increase by 1 for each new invoice. It should follow the same every time the month get's changed. *Example* If A2 is 05-02-2020 then F2 should be C200201 for first invoice in that month. for second invoice C200202 and if the month changes to say March then first value for F2 should be C200301. Now as value of cell "D2" is dependent upon cell "A2". *I need to run a macro whenever the value of D2 changes.* *I am only be changing the date, I don't want to change the value of cell "D2" manually.* I am having issues with automatic invoice no update, i.e, cell E2 value. *When the value of A2 get changed, the macro should run automatically. This macro will contain the set of codes for incrementing the value of cell "E2" by 1, which in turn will update the value of customer ID i.e, cell "F2" automatically* what is the possible vba code for this. please reply... Hope you got this. Thankyou.
@LoeblComServices3 жыл бұрын
This could be handled with a userform
@musebshaikh76173 жыл бұрын
suppose if in cell "A2" I have a date in "dd-mm-yyyy" and in cell "B2" I have used the formula "Month("A2")". Now as value of cell "B2" is dependent upon cell "A2". I need to run a macro whenever the value of B2 changes. I am only be changing the date, I don't want to change the value of cell "B2" manually. Here in this case cell address is not working. what should be the vba code for this. please reply.
@musebshaikh76173 жыл бұрын
@@LoeblComServices I have tried this one. It is working for every cell. I need for specific cell in which month() value is calculated
@musebshaikh76173 жыл бұрын
@@LoeblComServices can I get your mail id. Mine is [email protected]
@erickmonroy36333 жыл бұрын
Thanks for providing such a wonderful tutorial Erik, you're awesome!
@zealmao80553 жыл бұрын
Would you please tell me what to do if I want the expired product to be visualize in datagrid view using visual basic and access ? Thanks
@gsiinc44993 жыл бұрын
not your forty my friend, stick to what your good at....
@20kevron3 жыл бұрын
Awesome interview
@Ryan-dq6nn4 жыл бұрын
Edit it to LIKE AND PIN THIS COMMENT TO SAVE POSSIBLY A LIFE Pls help and possibly save his life with the platform you have .Kyle by 8 year old Kyle was Diagnosed with dipg an aggressive form of brain cancer in September 2019 possibly save his life by donating to the go fund me on Kyle www.gofundme.com/f/kyles-race-against-time @kylesarmy11
@MegaDibbler4 жыл бұрын
Sorry to add a question on a year old upload, but I'm stumped. This code is almost exactly what I'm looking for, so I thought I would reverse engineer it . I'm not very experienced in writing VBA, I have done a bit, but this is my first attempt with sql commands etc. I'm using Excel 2013 (is the ADO code correct for this version?) I copied & pasted your code from your vbastring site into the code page of a new form. I created a table with the right headings & named it newtable I created the buttons and a label on the new form using the same naming you did. It won't work as it won't find the table name, I get a 80040E37 error ever time I run it (cannot find "newtable") Are there any obvious gotcha's to make that the case? I've remade this 3 times from scratch in case I was looking through the issue... but I still can't find the issue. The named table is sat looking at me in the same workbook, but it isn't being found.
@ibrahimskakri55634 жыл бұрын
hello sir can you send this worksheet please to my email [email protected]
@LoeblComServices4 жыл бұрын
Thanks for asking. You can download the file from the website at www.vbastring.com/blog/how-to-use-excel-vba-to-loop-through-a-range-and-copy-conditionally/