Skip to content

Instantly share code, notes, and snippets.

View robwelan's full-sized avatar

Rob Welan robwelan

View GitHub Profile
<table style="width:90%" border="1" cellPadding="8" align="center">
<tbody>
<tr>
<td>
<aside>TIP: what if you need to modify one of your queries, or, create a new query based on an existing query that is contained in the tblOfQueries Table? It&#x27;s easy! Locate the query you need to work on or work with. Copy the query string that is in the qryString field. Now create a new query in Microsoft Access® in the normal way. Change to the SQL view of the query design space. Now replace whatever is there by pasting the string from the clipboard into the SQL area. Now change back to the design view. Unless you&#x27;re using something fancy like a UNION query, your regular query design space should be painted in the usual fashion with tables and criteria and such. One of the reasons I love Microsoft Access® so much! Make your changes and apply them back to the tblOfQueries by reverting back to the SQL view and copying the query from there back into the appropriate record in the tblOfQue
Function ExecuteSQL(strSQL As String) As Boolean
Dim adb As DAO.Database
On Error GoTo handle_Error
ExecuteSQL = False
Set adb = CurrentDb adb.Execute strSQL$, dbFailOnError
ExecuteSQL = True
Function ReturnStandardQuery(strQueryName As String) As String
Dim varMsg As Variant
On Error GoTo handle_Error
ReturnStandardQuery$ = CStr(DLookup("\[qryString]", "tblOfQueries", "\[qryName]='" & strQueryName$ & "'"))
If ReturnStandardQuery$ = "" Then GoTo handle_Error
exit_Gracefully:
<table style="width:90%" border="1" cellPadding="8" align="center">
<tbody>
<tr>
<td>
<aside>NOTE: You may have noticed that I include both a prefix and a suffix on my variable names, plus suffixes on functions that I write (where feasible). This is because I like my code to be readable and function in a strict sense. If I declare a variable with data type Long, but I put a $ suffix on it within the code (because I forgot, OK?), I&#x27;d like to be able to be warned of my mistake before I check with the debugger. The &quot;lng&quot; and &quot;str&quot; prefixes help prevent these sorts of blunders in my code. I feel that this forethought reduces the time required to get through functional testing. A lot of the simple bugs that one can create are eliminated by abiding by strict naming conventions.</aside>
</td>
</tr>
</tbody>
</table>
Sub DoWork_LookupTables()
Dim rsCheck As DAO.Recordset
Dim varMsg As Variant
Dim lngResult As Long
Dim strSQL As String
On Error GoTo handle_Error
// Check Applicant Country
Set rsCheck = Nothing
Private Sub cmdSave_Click()
...
// Update all lookup tables first...
Call DoWork_LookupTables
...
End Sub
<table style="width:100%" border="0">
<tbody>
<tr>
<td style="width:20%">Name</td>
<td>Count_ExistingApplicantCountryInCountries</td>
</tr>
<tr>
<td>String</td>
<td>SELECT Count(*) AS countCountries<br/>FROM tblCountries, tblTEMP_NewMemberEntry<br/>WHERE<br/>(((LCase(\[tblCountries.[CountryName]))=LCase(\[tblTEMP_NewMemberEntry]!\[applicantCountry])));</td>
</tr>
<table style="width:100%" border="0">
<thead>
<tr>
<th>Field Name</th>
<th>Data Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
@robwelan
robwelan / cot-blog-set-up-mongodb.js
Last active December 5, 2019 23:56
cot-blog-set-up-mongodb.js
// In your gatsby-config.js
require('dotenv').config({
path: `.env.${process.env.NODE_ENV}`,
});
module.exports = {
plugins: [
{
resolve: 'gatsby-source-mongodb',
options: {
import PropTypes from 'prop-types';
import React from 'react';
import MapGL, { Marker } from 'react-map-gl';
import PinDropIcon from '@material-ui/icons/PinDrop';
// Styles
import './map.css';
const token = process.env.GATSBY_MAPBOX_API;